home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / m2 / m2_part1.lha / modula / src / Graphics.def < prev    next >
Text File  |  1994-07-30  |  77KB  |  2,291 lines

  1. DEFINITION FOR LIBRARY MODULE Graphics ;
  2.  
  3. FROM SYSTEM    IMPORT ADDRESS, STRING, SHORTSET, LONGSET ;
  4.  
  5. FROM Exec    IMPORT Node, Message, NodePtr, SignalSemaphore, MsgPortPtr,
  6.                List, Library, Interrupt, TaskPtr, MinList,
  7.                SignalSemaphorePtr ;
  8.  
  9. FROM Utility    IMPORT TagItem, TAG_USER, TagItemPtr, HookPtr ;
  10.  
  11. FROM Hardware    IMPORT bltnodePtr, DISPLAYPAL, VARVBLANK, LOLDIS, VARVSYNC,
  12.                VARHSYNC, VARBEAM, CSBLANK, VSYNCTRUE ;
  13.  
  14. TYPE
  15.   CopInsPtr         =  POINTER TO CopIns ;
  16.   cprlistPtr         =  POINTER TO cprlist ;
  17.   CopListPtr         =  POINTER TO CopList ;
  18.   UCopListPtr         =  POINTER TO UCopList ;
  19.   copinitPtr         =  POINTER TO copinit ;
  20.   VSpritePtr         =  POINTER TO VSprite ;
  21.   BobPtr         =  POINTER TO Bob ;
  22.   AnimCompPtr         =  POINTER TO AnimComp ;
  23.   AnimObPtr         =  POINTER TO AnimOb ;
  24.   DBufPacketPtr         =  POINTER TO DBufPacket ;
  25.   collTablePtr         =  POINTER TO collTable ;
  26.   ExtendedNodePtr     =  POINTER TO ExtendedNode ;
  27.   IsrvstrPtr         =  POINTER TO Isrvstr ;
  28.   Layer_InfoPtr         =  POINTER TO Layer_Info ;
  29.   BitScaleArgsPtr     =  POINTER TO BitScaleArgs ;
  30.   SimpleSpritePtr     =  POINTER TO SimpleSprite ;
  31.   ExtSpritePtr         =  POINTER TO ExtSprite ;
  32.   TextAttrPtr         =  POINTER TO TextAttr ;
  33.   TTextAttrPtr         =  POINTER TO TTextAttr ;
  34.   TextFontPtr         =  POINTER TO TextFont  ;
  35.   TextFontExtensionPtr     =  POINTER TO TextFontExtension ;
  36.   ColorFontColorsPtr     =  POINTER TO ColorFontColors ;
  37.   ColorTextFontPtr     =  POINTER TO ColorTextFont ;
  38.   TextExtentPtr         =  POINTER TO TextExtentRec ;
  39.   MonitorSpecPtr     =  POINTER TO MonitorSpec ;
  40.   AnalogSignalIntervalPtr=  POINTER TO AnalogSignalInterval ;
  41.   SpecialMonitorPtr     =  POINTER TO SpecialMonitor ;
  42.   RectanglePtr         =  POINTER TO Rectangle ;
  43.   Rect32Ptr         =  POINTER TO Rect32 ;
  44.   BitMapPtr         =  POINTER TO BitMap ;
  45.   AreaInfoPtr         =  POINTER TO AreaInfo ;
  46.   TmpRasPtr         =  POINTER TO TmpRas ;
  47.   GelsInfoPtr         =  POINTER TO GelsInfo ;
  48.   RastPortPtr         =  POINTER TO RastPort ;
  49.   RegionRectanglePtr     =  POINTER TO RegionRectangle ;
  50.   RegionPtr         =  POINTER TO Region ;
  51.   LayerPtr         =  POINTER TO Layer ;
  52.   ClipRectPtr         =  POINTER TO ClipRect ;
  53.   QueryHeaderPtr     =  POINTER TO QueryHeader ;
  54.   DisplayInfoPtr     =  POINTER TO DisplayInfo ;
  55.   DimensionInfoPtr     =  POINTER TO DimensionInfo ;
  56.   MonitorInfoPtr     =  POINTER TO MonitorInfo ;
  57.   NameInfoPtr         =  POINTER TO NameInfo ;
  58.   ViewPortPtr         =  POINTER TO ViewPort ;
  59.   ViewPtr         =  POINTER TO View ;
  60.   ViewExtraPtr         =  POINTER TO ViewExtra ;
  61.   ViewPortExtraPtr     =  POINTER TO ViewPortExtra ;
  62.   RasInfoPtr         =  POINTER TO RasInfo ;
  63.   ColorMapPtr         =  POINTER TO ColorMap ;
  64.   PaletteExtraPtr     =  POINTER TO PaletteExtra ;
  65.   DBufInfoPtr         =  POINTER TO DBufInfo ;
  66.   GfxBasePtr         =  POINTER TO GfxBaseRec ;
  67.  
  68.  
  69. TYPE
  70.   Rectangle = RECORD
  71.     MinX , MinY : INTEGER ;
  72.     MaxX , MaxY : INTEGER ;
  73.   END ;
  74.  
  75.   Rect32 = RECORD
  76.     MinX , MinY : LONGINT ;
  77.     MaxX , MaxY : LONGINT ;
  78.   END ;
  79.  
  80.   tPoint = RECORD x , y : INTEGER END ;
  81.  
  82.   Point = tPoint ;
  83.  
  84.   PLANEPTR = ADDRESS ;
  85.  
  86.   BitMap = RECORD
  87.     BytesPerRow : CARDINAL  ;
  88.     Rows    : CARDINAL  ;
  89.     Flags    : SHORTSET  ;
  90.     Depth    : SHORTCARD ;
  91.     pad        : CARDINAL  ;
  92.     Planes    : ARRAY [0..7] OF PLANEPTR ;
  93.   END ;
  94.  
  95. (* This macro is obsolete as of V39.AllocBitMap()should be used for allocating*)
  96. (* bitmap data, since it knows about the machine's particular alignment          *)
  97. (* restrictions.                                  *)
  98.  
  99. PROCEDURE RASSIZE( w , h : CARDINAL ) : CARDINAL ;
  100.  
  101. (* flags for AllocBitMap, etc. *)
  102.  
  103. CONST
  104.   BMB_CLEAR      = 0 ;
  105.   BMB_DISPLAYABLE = 1 ;
  106.   BMB_INTERLEAVED = 2 ;
  107.   BMB_STANDARD      = 3 ;
  108.   BMB_MINPLANES   = 4 ;
  109.  
  110.   BMF_CLEAR      = {BMB_CLEAR} ;
  111.   BMF_DISPLAYABLE = {BMB_DISPLAYABLE} ;
  112.   BMF_INTERLEAVED = {BMB_INTERLEAVED} ;
  113.   BMF_STANDARD      = {BMB_STANDARD} ;
  114.   BMF_MINPLANES      = {BMB_MINPLANES} ;
  115.  
  116. (* the following are for GetBitMapAttr() *)
  117.   BMA_HEIGHT =  0 ;
  118.   BMA_DEPTH  =  4 ;
  119.   BMA_WIDTH  =  8 ;
  120.   BMA_FLAGS  = 12 ;
  121.  
  122. TYPE
  123.   AreaInfo = RECORD
  124.     VctrTbl    : ADDRESS ;    (* ptr to start of vector table              *)
  125.     VctrPtr    : ADDRESS ;    (* ptr to current vertex              *)
  126.     FlagTbl    : ADDRESS ;    (* ptr to start of vector flag table          *)
  127.     FlagPtr    : ADDRESS ;    (* ptrs to areafill flags              *)
  128.     Count    : INTEGER ;    (* number of vertices in list              *)
  129.     MaxCount    : INTEGER ;    (* AreaMove/Draw will not allow Count>MaxCount*)
  130.     FirstX     : INTEGER ;
  131.     FirstY    : INTEGER ;    (* first point for this polygon              *)
  132.   END ;
  133.  
  134.   TmpRas = RECORD
  135.     RasPtr : ADDRESS ;
  136.     Size   : LONGINT ;
  137.   END ;
  138.  
  139. (* unoptimized for 32bit alignment of pointers *)
  140.  
  141.   GelsInfo = RECORD
  142.     sprRsrvd      : SHORTCARD  ; (* flag of which sprites to reserve from *)
  143.                      (* vsprite system              *)
  144.     Flags      : SHORTSET   ; (* system use                  *)
  145.     gelHead      : VSpritePtr ;
  146.     gelTail      : VSpritePtr ; (* dummy vSprites for list management      *)
  147.  
  148.     nextLine      : ADDRESS ;    (* pointer to array of 8 WORDS for sprite*)
  149.                      (* available lines              *)
  150.  
  151.     lastColor      : ADDRESS ;    (* pointer to array of 8 pointers for      *)
  152.                      (* color-last-assigned to vSprites      *)
  153.     collHandler      : collTablePtr;(* addresses of collision routines      *)
  154.     leftmost      : INTEGER ;
  155.     rightmost      : INTEGER ;
  156.     topmost      : INTEGER ;
  157.     bottommost      : INTEGER ;
  158.     firstBlissObj : ADDRESS ;
  159.     lastBlissObj  : ADDRESS ;    (* system use only              *)
  160.   END ;
  161.  
  162.   RastPort = RECORD
  163.     Layer    : LayerPtr ;
  164.     BitMap    : BitMapPtr ;
  165.     AreaPtrn     : ADDRESS ;    (* ptr to areafill pattern          *)
  166.     TmpRas    : TmpRasPtr ;
  167.     AreaInfo     : AreaInfoPtr ;
  168.     GelsInfo     : GelsInfoPtr ;
  169.     Mask    : SHORTSET ;    (* write mask for this raster          *)
  170.     FgPen    : SHORTINT ;    (* foreground pen for this raster      *)
  171.     BgPen    : SHORTINT ;    (* background pen              *)
  172.     AOlPen    : SHORTINT ;    (* areafill outline pen              *)
  173.     DrawMode    : SHORTSET ;    (* drawing mode for fill, lines, and text *)
  174.     AreaPtSz     : SHORTINT ;    (* 2^n words for areafill pattern      *)
  175.     linpatcnt     : SHORTINT ;    (* current line drawing pattern preshift  *)
  176.     dummy    : SHORTINT ;
  177.     Flags    : BITSET  ;    (* miscellaneous control bits          *)
  178.     LinePtrn     : CARDINAL ;    (* 16 bits for textured lines          *)
  179.     cp_x    : INTEGER ;
  180.     cp_y    : INTEGER ;    (* current pen position              *)
  181.     minterms    : ARRAY [0..7] OF SHORTINT ;
  182.     PenWidth    : INTEGER ;
  183.     PenHeight    : INTEGER ;
  184.     Font    : TextFontPtr ;    (* current font address              *)
  185.     AlgoStyle    : SHORTSET ;    (* the algorithmically generated style      *)
  186.     TxFlags    : SHORTSET ;    (* text specific flags              *)
  187.     TxHeight    : CARDINAL ;    (* text height                  *)
  188.     TxWidth    : CARDINAL ;    (* text nominal width              *)
  189.     TxBaseline    : CARDINAL ;    (* text baseline              *)
  190.     TxSpacing     : INTEGER ;    (* text spacing (per character)          *)
  191.     RP_User    : ADDRESS ;
  192.     longreserved: ARRAY [0..1] OF LONGINT  ;
  193.     wordreserved: ARRAY [0..6] OF INTEGER  ; (* used to be a node      *)
  194.     reserved    : ARRAY [0..7] OF SHORTINT ; (* for future use          *)
  195.   END;
  196.  
  197. CONST
  198.   (* drawing modes *)
  199.   JAM1         = {}  ;    (* jam 1 color into raster            *)
  200.   JAM2         = {0} ;    (* jam 2 colors into raster            *)
  201.   COMPLEMENT = {1} ;    (* XOR bits into raster                *)
  202.   INVERSVID  = {2} ;    (* inverse video for drawing modes        *)
  203.  
  204.   (* these are the flag bits for RastPort flags *)
  205.  
  206.   FRST_DOT = {0} ;    (* draw the first dot of this line ?        *)
  207.   ONE_DOT  = {1} ;    (* use one dot mode for drawing lines        *)
  208.   DBUFFER  = {2} ;    (* flag set when RastPorts are double-buffered    *)
  209.  
  210. (* only used for bobs *)
  211.  
  212.   AREAOUTLINE = {3} ;    (* used by areafiller        *)
  213.   NOCROSSFILL = {5} ;    (* areafills have no crossovers *)
  214.  
  215. (* there is only one style of clipping: raster clipping              *)
  216. (* this preserves the continuity of jaggies regardless of clip window      *)
  217. (* When drawing into a RastPort, if the ptr to ClipRect is nil then there *)
  218. (* is no clipping done, this is dangerous but useful for speed          *)
  219.  
  220. TYPE
  221.   RegionRectangle = RECORD
  222.     Next , Prev : RegionRectanglePtr ;
  223.     bounds : Rectangle ;
  224.   END ;
  225.  
  226.   Region = RECORD
  227.     bounds : Rectangle ;
  228.     RegionRectangle : RegionRectanglePtr ;
  229.   END ;
  230.  
  231.   Layer = RECORD
  232.     front , back    : LayerPtr ;    (* ignored by roms              *)
  233.     ClipRect        : ClipRectPtr ;    (* read by roms to find first cliprect*)
  234.     rp            : RastPortPtr ;
  235.     bound        : Rectangle ;    (* ignored by roms              *)
  236.     reserved        : ARRAY [0..3] OF SHORTINT ;
  237.     priority        : CARDINAL ;    (* system use only              *)
  238.     Flags        : BITSET  ;    (* obscured ?, Virtual BitMap?          *)
  239.     SuperBitMap        : BitMapPtr ;
  240.     SuperClipRect    : ClipRectPtr;    (* super bitmap cliprects if          *)
  241.                         (* VBitMap != 0 else damage cliprect  *)
  242.                         (* list for refresh              *)
  243.  
  244.     Window        : ADDRESS ;    (* reserved for user interface use    *)
  245.     Scroll_X, Scroll_Y    : INTEGER ;
  246.     cr, cr2, crnew    : ClipRectPtr ;    (* used by dedice              *)
  247.     SuperSaveClipRects    : ClipRectPtr ; (* preallocated cr's              *)
  248.     _cliprects        : ClipRectPtr ;    (* system use during refresh          *)
  249.     LayerInfo        : Layer_InfoPtr;(* points to head of the list          *)
  250.     Lock        : SignalSemaphore ;
  251.     reserved3        : ARRAY [0..7] OF SHORTINT ;
  252.     ClipRegion        : RegionPtr ;
  253.     saveClipRects    : RegionPtr ;    (* used to back out when in trouble   *)
  254.     Width,Height    : INTEGER ;    (* system use                  *)
  255.     reserved2        : ARRAY [0..17] OF SHORTCARD ;
  256.     (* this must stay here *)
  257.     DamageList        : RegionPtr ;    (* list of rectngls to refresh throug *)
  258.   END ;
  259.  
  260.   ClipRect = RECORD
  261.     Next    : ClipRectPtr ;    (* roms used to find next ClipRect    *)
  262.     prev    : ClipRectPtr ; (* Temp use in layers (private)        *)
  263.     lobs    : LayerPtr    ; (* Private use for layers        *)
  264.     BitMap    : BitMapPtr   ; (* Bitmap for layers private use    *)
  265.     bounds    : Rectangle   ; (* bounds of cliprect            *)
  266.     _p1,_p2    : ADDRESS     ;    (* system reserved            *)
  267.     reserved    : LONGINT     ;    (* system use                *)
  268.   END ;
  269.  
  270. CONST
  271.  
  272.   (* internal cliprect flags *)
  273.  
  274.   CR_NEEDS_NO_CONCEALED_RASTERS  = 1 ;
  275.   CR_NEEDS_NO_LAYERBLIT_DAMAGE   = 2 ;
  276.  
  277.   (* defines for code values for getcode *)
  278.  
  279.   ISLESSX = 1 ;
  280.   ISLESSY = 2 ;
  281.   ISGRTRX = 4 ;
  282.   ISGRTRY = 8 ;
  283.  
  284.  
  285. CONST  (* VSprite flags *)
  286.  
  287.   (* user-set VSprite flags: *)
  288.   SUSERFLAGS  = {0..7} ; (* mask of all user-settable VSprite-flags *)
  289.  
  290.   VSPRITE     = {0} ; (* set if VSprite, clear if Bob            *)
  291.   SAVEBACK    = {1} ; (* set if background is to be saved/restored    *)
  292.   OVERLAY     = {2} ; (* set to mask image of Bob onto background    *)
  293.   MUSTDRAW    = {3} ; (* set if VSprite absolutely must be drawn    *)
  294.  
  295.   (* system-set VSprite flags: *)
  296.  
  297.   BACKSAVED   = {8}  ; (* this Bob's background has been saved        *)
  298.   BOBUPDATE   = {9}  ; (* temporary flag, useless to outside world    *)
  299.   GELGONE     = {10} ; (* set if gel is completely clipped (offscreen)    *)
  300.   VSOVERFLOW  = {11} ; (* VSprite overflow (if MUSTDRAW set we draw!)    *)
  301.  
  302.   (* Bob flags *)
  303.   (* these are the user flag bits *)
  304.  
  305.   BUSERFLAGS     = {0..7} ; (* mask of all user-settable Bob-flags    *)
  306.   SAVEBOB    = {0} ;    (* set to not erase Bob            *)
  307.   BOBISCOMP    = {1} ;    (* set to identify Bob as AnimComp        *)
  308.  
  309.   (* these are the system flag bits *)
  310.  
  311.   BWAITING    = {08} ; (* set while Bob is waiting on 'after'        *)
  312.   BDRAWN    = {09} ; (* set when Bob is drawn this DrawG pass    *)
  313.   BOBSAWAY       = {10} ; (* set to initiate removal of Bob        *)
  314.   BOBNIX    = {11} ; (* set when Bob is completely removed        *)
  315.   SAVEPRESERVE    = {12} ; (* for back-restore during double-buffer    *)
  316.   OUTSTEP    = {13} ; (* for double-clearing if double-buffer    *)
  317.  
  318.   (* defines for the animation procedures *)
  319.   ANFRACSIZE  = 00006H ;
  320.   ANIMHALF    = 00020H ;
  321.   RINGTRIGGER = 00001H ;
  322.  
  323.  
  324. (* UserStuff definitions                              *)
  325. (*  Modula does not have an #include or an extensible datatype mechanism,     *)
  326. (* if you need to add your own data ( and integer is inappropriate ) declare  *)
  327. (* something like                                  *)
  328. (*                                          *)
  329. (*       TYPE                                      *)
  330. (*         BobExt = RECORD bob : Bob ; userStuff : <..> END ;              *)
  331. (*                                          *)
  332. (*  and access userStuff using casts.                          *)
  333. (*                                          *)
  334. (* see the manual for a thorough definition of the UserStuff definitions      *)
  335.  
  336. TYPE
  337.   VUserStuff = INTEGER ;  (* Sprite user stuff  *)
  338.   BUserStuff = INTEGER ;  (* Bob user stuff    *)
  339.   AUserStuff = INTEGER ;  (* AnimOb user stuff    *)
  340.  
  341.  
  342. (*--------------------- GEL STRUCTURES -------------------------------------*)
  343.  
  344.  
  345. TYPE
  346.   VSprite = RECORD
  347.     (* GEL linked list forward/backward pointers sorted by y,x value *)
  348.  
  349.     NextVSprite : VSpritePtr ;
  350.     PrevVSprite : VSpritePtr ;
  351.  
  352.     (* GEL draw list constructed in the order the Bobs are actually drawn, *)
  353.     (*  then list is copied to clear list                   *)
  354.     (*  must be here in VSprite for system boundary detection           *)
  355.  
  356.     DrawPath    : VSpritePtr ; (* pointer of overlay drawing   *)
  357.     ClearPath    : VSpritePtr ; (* pointer for overlay clearing *)
  358.  
  359.     (* the VSprite positions are defined in (y,x) order to make sorting  *)
  360.     (*  sorting easier, since (y,x) as a long integer             *)
  361.  
  362.     OldY, OldX    : INTEGER ; (* previous position *)
  363.     Flags    : BITSET  ; (* VSprite flags     *)
  364.  
  365.     (* the VSprite positions are defined in (y,x) order to make sorting *)
  366.     (* sorting easier, since (y,x) as a long integer            *)
  367.  
  368.     Y, X     : INTEGER ; (* screen position                 *)
  369.     Height    : INTEGER ;
  370.     Width    : INTEGER ; (* number of words per row of image data     *)
  371.     Depth    : INTEGER ; (* number of planes of data             *)
  372.     MeMask    : BITSET  ; (* which types can collide with this VSprite *)
  373.     HitMask    : BITSET  ; (* which types this VSprite can collide with *)
  374.     ImageData    : ADDRESS ; (* pointer to VSprite image             *)
  375.  
  376.     (* borderLine is the one-dimensional logical OR of all       *)
  377.     (* the VSprite bits, used for fast collision detection of edge *)
  378.  
  379.     BorderLine    : ADDRESS ; (* logical OR of all VSprite bits            *)
  380.     CollMask    : ADDRESS ; (* similar to above except this is a matrix *)
  381.  
  382.     (* pointer to this VSprite's color definitions (not used by Bobs)    *)
  383.  
  384.     SprColors    : ADDRESS ;
  385.     VSBob    : BobPtr  ; (* points home if this VSprite is part of a Bob *)
  386.  
  387. (* planePick flag:  set bit selects a plane from image, clear bit selects     *)
  388. (*  use of shadow mask for that plane                          *)
  389. (* OnOff flag: if using shadow mask to fill plane, this bit (corresponding    *)
  390. (*  to bit in planePick) describes whether to fill with 0's or 1's          *)
  391. (* There are two uses for these flags:                          *)
  392. (*   - if this is the VSprite of a Bob, these flags describe how the Bob      *)
  393. (*     is to be drawn into memory                          *)
  394. (*   - if this is a simple VSprite and the user intends on setting the        *)
  395. (*     MUSTDRAW flag of the VSprite, these flags must be set too to describe  *)
  396. (*     which color registers the user wants for the image              *)
  397.  
  398.     PlanePick  : SHORTINT ;
  399.     PlaneOnOff : SHORTINT ;
  400.     VUserExt   : VUserStuff ;
  401.   END ;
  402.  
  403.  
  404.   Bob = RECORD
  405.     Flags    : BITSET  ; (* general purpose flags (see definitions below)  *)
  406.     SaveBuffer    : ADDRESS ; (* pointer to the buffer for background save      *)
  407.     ImageShadow : ADDRESS ; (* used by Bobs for "cookie-cutting"          *)
  408.                     (* and multi-plane masking                  *)
  409.  
  410.     (* pointer to BOBs for sequenced drawing of Bobs        *)
  411.     (* for correct overlaying of multiple component animations    *)
  412.  
  413.     Before    : BobPtr    ; (* draw this Bob before Bob pointed to *)
  414.                       (* by before                 *)
  415.     After     : BobPtr    ; (* draw this Bob after Bob pointed to  *)
  416.                       (* by after                 *)
  417.     BobVSprite    : VSpritePtr    ; (* this Bob's VSprite definition     *)
  418.     BobComp    : AnimCompPtr    ; (* pointer to this Bob's AnimComp def  *)
  419.     DBuffer    : DBufPacketPtr    ; (* pointer to this Bob's dBuf packet     *)
  420.     BUserExt    : BUserStuff    ; (* Bob user extension             *)
  421.   END ;
  422.  
  423.  
  424.   AnimComp = RECORD
  425.     Flags    : BITSET  ;    (* AnimComp flags for system & user          *)
  426.     Timer    : INTEGER ;    (* timer defines how long to keep this          *)
  427.                 (* component active:                  *)
  428.                 (* if set non-zero, timer decrements to zero  *)
  429.                 (* then switches to nextSeq if set to zero,   *)
  430.                 (* AnimComp never switches              *)
  431.  
  432.     TimeSet    : INTEGER ;    (* initial value for timer when the AnimComp  *)
  433.                     (* is activated by the system              *)
  434.     NextComp    : AnimCompPtr ;    (* pointer to next and previous components of *)
  435.                     (* animation object                  *)
  436.     PrevComp    : AnimCompPtr ;
  437.     NextSeq    : AnimCompPtr ;    (* pointer to component component definition  *)
  438.                     (* of next image in sequence              *)
  439.     PrevSeq    : AnimCompPtr ;
  440.     AnimCRoutine: PROCEDURE( ) : INTEGER ;
  441.                     (* address of special animation procedure     *)
  442.     YTrans    : INTEGER ;     (* init y translation (if this is a component)*)
  443.     XTrans    : INTEGER ;     (* init x translation (if this is a component)*)
  444.     HeadOb    : AnimObPtr ;
  445.     AnimBob    : BobPtr ;
  446.   END ;
  447.  
  448.  
  449.  AnimOb = RECORD
  450.     NextOb, PrevOb : AnimObPtr ;
  451.  
  452. (* number of calls to Animate this AnimOb has endured *)
  453.     Clock        : LONGINT ;
  454.     AnOldY, AnOldX    : INTEGER ; (* old y,x coordinates        *)
  455.     AnY, AnX        : INTEGER ; (* y,x coordinates of the AnimOb    *)
  456.     YVel, XVel        : INTEGER ; (* velocities of this object    *)
  457.     YAccel, XAccel    : INTEGER ; (* accelerations of this object    *)
  458.     RingYTrans,
  459.     RingXTrans        : INTEGER ; (* ring translation values        *)
  460.     AnimORoutine    : PROCEDURE(): INTEGER ;
  461.                   (* address of special animation procedure *)
  462.  
  463.     HeadComp        : AnimCompPtr ; (* pointer to first component    *)
  464.     AUserExt        : AUserStuff  ;    (* AnimOb user extension    *)
  465.   END ;
  466.  
  467. (* dBufPacket defines the values needed to be saved across buffer to buffer   *)
  468. (*  when in double-buffer mode                              *)
  469.  
  470.   DBufPacket = RECORD
  471.     BufY, BufX    : INTEGER    ; (* save the other buffers screen coordinates *)
  472.     BufPath    : VSpritePtr ; (* carry the draw path over the gap        *)
  473.  
  474.     (* these pointers must be filled in by the user *)
  475.     (* pointer to other buffer's background save buffer *)
  476.  
  477.     BufBuffer    : ADDRESS ;
  478.   END ;
  479.  
  480. (*-------------------------- Gels Macros ---------------------------------*)
  481.  
  482. PROCEDURE InitAnimate( animKey : ADDRESS ) ;
  483. PROCEDURE RemBob( b : BobPtr ) ;
  484.  
  485. (*------------------------------------------------------------------------*)
  486.  
  487. CONST
  488.   B2NORM   = 0 ;
  489.   B2SWAP   = 1 ;
  490.   B2BOBBER = 2 ;
  491.  
  492. (*------------------------------------------------------------------------*)
  493.  
  494. (* a structure to contain the 16 collision procedure addresses *)
  495.  
  496. TYPE
  497.   LongProc = PROCEDURE( ) : LONGINT ;
  498.   collTable = RECORD
  499.     collPtrs : ARRAY [0..15] OF LongProc ;
  500.   END ;
  501.  
  502.   ExtendedNode = RECORD
  503.     xln_Succ      : NodePtr ;
  504.     xln_Pred      : NodePtr ;
  505.     xln_Type      : SHORTCARD ;
  506.     xln_Pri       : SHORTINT ;
  507.     xln_Name      : STRING ;
  508.     xln_Subsystem : SHORTCARD ;
  509.     xln_Subtype      : SHORTCARD ;
  510.     xln_Library      : LONGINT ;
  511.     xln_Init      : LongProc ;
  512.   END ;
  513.  
  514. CONST
  515.   SS_GRAPHICS = 002H ;
  516.  
  517.   VIEW_EXTRA_TYPE    = 1 ;
  518.   VIEWPORT_EXTRA_TYPE    = 2 ;
  519.   SPECIAL_MONITOR_TYPE    = 3 ;
  520.   MONITOR_SPEC_TYPE    = 4 ;
  521.  
  522.   (* structure used by AddTOFTask *)
  523.  
  524. TYPE
  525.   Isrvstr = RECORD
  526.     is_Node : Node ;
  527.     Iptr    : IsrvstrPtr ;   (* passed to srvr by os *)
  528.     code    : LongProc ;
  529.     ccode   : LongProc ;
  530.     Carg    : LONGINT  ;
  531.   END ;
  532.  
  533. CONST
  534.   LAYERSIMPLE        = {0} ;
  535.   LAYERSMART        = {1} ;
  536.   LAYERSUPER        = {2} ;
  537.   LAYERUPDATING        = {4} ;
  538.   LAYERBACKDROP        = {6} ;
  539.   LAYERREFRESH        = {7} ;
  540.   LAYERIREFRESH        = {9} ;
  541.   LAYERIREFRESH2    = {10};
  542.   LAYER_CLIPRECTS_LOST    = {8} ;    (* during BeginUpdate         *)
  543.                 (* or during layerop         *)
  544.                 (* this happens if out of memory *)
  545.  
  546. TYPE
  547.   Layer_Info = RECORD
  548.     top_layer        : LayerPtr ;
  549.     check_lp        : LayerPtr ;        (* !! Private !! *)
  550.     obs            : ClipRectPtr ;
  551.     FreeClipRects    : ClipRectPtr ;        (* !! Private !! *)
  552.     PrivateReserve1    : LONGINT ;        (* !! Private !! *)
  553.     PrivateReserve2    : LONGINT ;        (* !! Private !! *)
  554.     Lock        : SignalSemaphore ;    (* !! Private !! *)
  555.     gs_Head        : MinList ;        (* !! Private !! *)
  556.     PrivateReserve3    : INTEGER ;        (* !! Private !! *)
  557.     PrivateReserve4    : ADDRESS ;        (* !! Private !! *)
  558.     Flags        : BITSET   ;
  559.     fatten_count    : SHORTINT ;        (* !! Private !! *)
  560.     LockLayersCount    : SHORTINT ;        (* !! Private !! *)
  561.     PrivateReserve5    : INTEGER  ;        (* !! Private !! *)
  562.     BlankHook        : ADDRESS  ;        (* !! Private !! *)
  563.     LayerInfo_extra    : ADDRESS  ;        (* !! Private !! *)
  564.   END ;
  565.  
  566. CONST
  567.   NEWLAYERINFO_CALLED = 1 ;
  568.  
  569.   (* LAYERS_NOBACKFILL is the value needed to get no backfill hook      *)
  570.   (* LAYERS_BACKFILL is the value needed to get the default backfill hook *)
  571.  
  572.   LAYERS_NOBACKFILL = HookPtr( 1 ) ;
  573.   LAYERS_BACKFILL   = HookPtr( 0 ) ;
  574.  
  575.  
  576.   RPTAG_Font        = 080000000H ;    (* get/set font                  *)
  577.   RPTAG_APen        = 080000002H ;    (* get/set apen                  *)
  578.   RPTAG_BPen        = 080000003H ;    (* get/set bpen                  *)
  579.   RPTAG_DrMd        = 080000004H ;    (* get/set draw mode              *)
  580.   RPTAG_OutLinePen    = 080000005H ;    (* get/set outline pen              *)
  581.   RPTAG_OutlinePen    = 080000005H ;    (* get/set outline pen.corrected case *)
  582.   RPTAG_WriteMask    = 080000006H ;    (* get/set WriteMask              *)
  583.   RPTAG_MaxPen        = 080000007H ;    (* get/set maxpen              *)
  584.  
  585.   RPTAG_DrawBounds    = 080000008H ;    (* get only rastport draw bounds.     *)
  586.                       (* pass & rect                  *)
  587.  
  588. TYPE
  589.   BitScaleArgs = RECORD
  590.     bsa_SrcX        : CARDINAL ;
  591.     bsa_SrcY        : CARDINAL ;    (* source origin         *)
  592.     bsa_SrcWidth    : CARDINAL ;
  593.     bsa_SrcHeight    : CARDINAL ;    (* source size             *)
  594.     bsa_XSrcFactor    : CARDINAL ;
  595.     bsa_YSrcFactor    : CARDINAL ;    (* scale factor denominators     *)
  596.     bsa_DestX        : CARDINAL ;
  597.     bsa_DestY        : CARDINAL ;    (* destination origin        *)
  598.     bsa_DestWidth    : CARDINAL ;
  599.     bsa_DestHeight    : CARDINAL ;    (* destination size result    *)
  600.     bsa_XDestFactor    : CARDINAL ;
  601.     bsa_YDestFactor    : CARDINAL ;    (* scale factor numerators    *)
  602.     bsa_SrcBitMap     : BitMapPtr;    (* source BitMap        *)
  603.     bsa_DestBitMap    : BitMapPtr;    (* destination BitMap        *)
  604.     bsa_Flags        : LONGSET  ;    (* reserved.  Must be zero!    *)
  605.     bsa_XDDA, bsa_YDDA    : CARDINAL ;    (* reserved            *)
  606.     bsa_Reserved1    : LONGINT  ;
  607.     bsa_Reserved2    : LONGINT  ;
  608.   END ;
  609.  
  610. CONST
  611.   SPRITE_ATTACHED = 080H ;
  612.  
  613. TYPE
  614.   SimpleSprite = RECORD
  615.     posctldata    : ADDRESS  ;
  616.     height    : CARDINAL ;
  617.     x , y    : CARDINAL ; (* current position *)
  618.     num        : CARDINAL ;
  619.   END ;
  620.  
  621.   ExtSprite = RECORD
  622.     es_SimpleSprite : SimpleSprite ; (* conventional simple sprite structure *)
  623.     es_wordwidth    : CARDINAL ;     (* graphics use only, subject to change *)
  624.     es_flags        : BITSET  ;         (* graphics use only, subject to change *)
  625.   END ;
  626.  
  627. CONST
  628.   (* tags for AllocSpriteData() *)
  629.  
  630.   SPRITEA_Width        = 081000000H ;
  631.   SPRITEA_XReplication    = 081000002H ;
  632.   SPRITEA_YReplication    = 081000004H ;
  633.   SPRITEA_OutputHeight    = 081000006H ;
  634.   SPRITEA_Attached    = 081000008H ;
  635.   SPRITEA_OldDataFormat    = 08100000AH ;
  636.                 (* MUST pass in outputheight if using this tag *)
  637.  
  638.   (* tags for GetExtSprite() *)
  639.  
  640.   GSTAG_SPRITE_NUM = 082000020H ;
  641.   GSTAG_ATTACHED   = 082000022H ;
  642.   GSTAG_SOFTSPRITE = 082000024H ;
  643.  
  644.   (* tags valid for either GetExtSprite or ChangeExtSprite *)
  645.  
  646.   GSTAG_SCANDOUBLED = 083000000H ; (* request "NTSC-Like" height if possible *)
  647.  
  648. (*---------------------------------------------------------------------------*)
  649.  
  650. TYPE
  651.   ViewPort = RECORD
  652.     Next    : ViewPortPtr ;
  653.     ColorMap    : ColorMapPtr ;    (* table of colors for this viewport *)
  654.                 (* if this is nil, MakeVPort assumes *)
  655.                 (* default values             *)
  656.  
  657.     DspIns    : CopListPtr ;    (* user by MakeView()    *)
  658.     SprIns    : CopListPtr ;    (* used by sprite stuff    *)
  659.     ClrIns    : CopListPtr ;    (* used by sprite stuff    *)
  660.     UCopIns    : UCopListPtr ;    (* User copper list    *)
  661.     DWidth    : INTEGER ;
  662.     DHeight    : INTEGER ;
  663.     DxOffset    : INTEGER ;
  664.     DyOffset    : INTEGER ;
  665.     Modes    : BITSET  ;
  666.     SpritePriorities : SHORTCARD ;
  667.     ExtendedModes : SHORTSET ;
  668.     RasInfo    : RasInfoPtr ;
  669.   END ;
  670.  
  671.   View = RECORD
  672.     ViewPort   : ViewPortPtr ;
  673.     LOFCprList : cprlistPtr ; (* used for interlaced and noninterlaced     *)
  674.     SHFCprList : cprlistPtr ; (* only used during interlace           *)
  675.     DyOffset   : INTEGER    ;
  676.     DxOffset   : INTEGER    ; (* for complete View positioning           *)
  677.                   (* offsets are +- adjustments to standard #s *)
  678.     Modes      : BITSET     ; (* such as INTERLACE, GENLOC           *)
  679.   END ;
  680.  
  681.  
  682.   (* these structures are obtained via GfxNew *)
  683.   (* and disposed by GfxFree              *)
  684.  
  685.   ViewExtra = RECORD
  686.     n        : ExtendedNode   ;
  687.     View    : ViewPtr         ;    (* backwards link      *)
  688.     Monitor : MonitorSpecPtr ;    (* monitors for this view *)
  689.     TopLine : CARDINAL         ;
  690.   END ;
  691.  
  692.   (* this structure is obtained via GfxNew *)
  693.   (* and disposed by GfxFree           *)
  694.  
  695.   ViewPortExtra = RECORD
  696.     n         : ExtendedNode ;
  697.     ViewPort    : ViewPortPtr ;    (* backwards link              *)
  698.     DisplayClip : Rectangle ;    (* MakeVPort display clipping information *)
  699.  
  700.     (* These are added for V39 *)
  701.  
  702.     VecTable    : ADDRESS ; (* Private *)
  703.     DriverData    : ARRAY [0..1] OF ADDRESS ;
  704.     Flags    : BITSET  ;
  705.     Origin    : ARRAY [0..1] OF Point;(* First visible point relative to  *)
  706.                         (* the DClip.                *)
  707.                     (* One for each possible playfield. *)
  708.  
  709.     cop1ptr    : ADDRESS ; (* private *)
  710.     cop2ptr    : ADDRESS ; (* private *)
  711.   END ;
  712.  
  713. CONST
  714.  
  715.   (* All these VPXF_flags are private *)
  716.  
  717.   VPXB_FREE_ME        = 0 ;
  718.   VPXF_FREE_ME        = {VPXB_FREE_ME} ;
  719.   VPXB_LAST        = 1 ;
  720.   VPXF_LAST        = {VPXB_LAST} ;
  721.   VPXB_STRADDLES_256    = 4 ;
  722.   VPXF_STRADDLES_256    = {VPXB_STRADDLES_256} ;
  723.   VPXB_STRADDLES_512    = 5 ;
  724.   VPXF_STRADDLES_512    = {VPXB_STRADDLES_512} ;
  725.  
  726.  
  727.   EXTEND_VSTRUCT    = {12}; (* unused bit in Modes field of View    *)
  728.  
  729.   VPF_A2024        = {6} ;    (* VP?_ fields internal only        *)
  730.   (*  VPF_TENHZ        = {5} ; does not match VPB_TENHZ ??*)
  731.   VPB_A2024        =  6  ;
  732.   (*  VPB_TENHZ        =  4  ;*)
  733.  
  734.   (* defines used for Modes in IVPargs *)
  735.  
  736.   GENLOCK_VIDEO      =  {1} ;
  737.   LACE          =  {2} ;
  738.   DOUBLESCAN      =  {3} ;
  739.   SUPERHIRES      =  {5} ;
  740.   PFBA          =  {6} ;
  741.   EXTRA_HALFBRITE =  {7} ;
  742.   GENLOCK_AUDIO      =  {8} ;
  743.   DUALPF      = {10} ;
  744.   HAM          = {11} ;
  745.   EXTENDED_MODE      = {12} ;
  746.   VP_HIDE      = {13} ;
  747.   SPRITES      = {14} ;
  748.   HIRES          = {15} ;
  749.  
  750. TYPE
  751.   RasInfo = RECORD (* used by callers to and InitDspC() *)
  752.     Next    : RasInfoPtr ; (* used for dualpf        *)
  753.     BitMap    : BitMapPtr  ;
  754.     RxOffset    : INTEGER    ;
  755.     RyOffset    : INTEGER    ; (* scroll offsets in this BitMap *)
  756.   END ;
  757.  
  758.   ColorMap = RECORD
  759.     Flags        : SHORTSET ;
  760.     Type        : SHORTCARD ;
  761.     Count        : CARDINAL ;
  762.     ColorTable        : ADDRESS ;
  763.     cm_vpe        : ViewPortExtraPtr ;
  764.     LowColorBits    : ADDRESS ;
  765.     TransparencyPlane    : SHORTCARD ;
  766.     SpriteResolution    : SHORTCARD ;
  767.     SpriteResDefault    : SHORTCARD ;(* what resolution you get when you have *)
  768.                          (* set SPRITERESN_DEFAULT              *)
  769.     AuxFlags        : SHORTSET ;
  770.     cm_vp        : ViewPortPtr ;
  771.     NormalDisplayInfo    : ADDRESS ;
  772.     CoerceDisplayInfo    : ADDRESS ;
  773.     cm_batch_items    : TagItemPtr ;
  774.     VPModeID        : LONGINT ;
  775.     PalExtra        : PaletteExtraPtr ;
  776.     SpriteBase_Even    : CARDINAL ;
  777.     SpriteBase_Odd    : CARDINAL ;
  778.     Bp_0_base        : CARDINAL ;
  779.     Bp_1_base        : CARDINAL ;
  780.   END ;
  781.  
  782. (* if Type == 0 then ColorMap is V1.2/V1.3 compatible *)
  783. (* if Type != 0 then ColorMap is V38       compatible *)
  784. (* the system will never create other than V39 type colormaps when running V39*)
  785.  
  786. CONST
  787.   COLORMAP_TYPE_V1_2    = 000 ;
  788.   COLORMAP_TYPE_V1_4    = 001 ;
  789.   COLORMAP_TYPE_V36    = COLORMAP_TYPE_V1_4 ;    (* use this definition *)
  790.   COLORMAP_TYPE_V39    = 002 ;
  791.  
  792.   (* Flags variable *)
  793.  
  794.   COLORMAP_TRANSPARENCY      = {0} ;
  795.   COLORPLANE_TRANSPARENCY = {1} ;
  796.   BORDER_BLANKING      = {2} ;
  797.   BORDER_NOTRANSPARENCY      = {3} ;
  798.   VIDEOCONTROL_BATCH      = {4} ;
  799.   USER_COPPER_CLIP      = {5} ;
  800.   BORDERSPRITES          = {6} ;
  801.  
  802.   CMF_CMTRANS    = 0 ;
  803.   CMF_CPTRANS    = 1 ;
  804.   CMF_BRDRBLNK    = 2 ;
  805.   CMF_BRDNTRAN    = 3 ;
  806.   CMF_BRDRSPRT    = 6 ;
  807.  
  808.   SPRITERESN_ECS= 0 ;
  809.  
  810.   (* ^140ns, except in 35ns viewport, where it is 70ns. *)
  811.  
  812.   SPRITERESN_140NS    = 1 ;
  813.   SPRITERESN_70NS    = 2 ;
  814.   SPRITERESN_35NS    = 3 ;
  815.   SPRITERESN_DEFAULT    =-1 ;
  816.  
  817.   (* AuxFlags : *)
  818.  
  819.   CMAB_FULLPALETTE        = 0 ;
  820.   CMAF_FULLPALETTE        = {CMAB_FULLPALETTE};
  821.   CMAB_NO_INTERMED_UPDATE     = 1 ;
  822.   CMAF_NO_INTERMED_UPDATE     = {CMAB_NO_INTERMED_UPDATE};
  823.   CMAB_NO_COLOR_LOAD         = 2 ;
  824.   CMAF_NO_COLOR_LOAD        = {CMAB_NO_COLOR_LOAD} ;
  825.   CMAB_DUALPF_DISABLE        = 3 ;
  826.   CMAF_DUALPF_DISABLE        = {CMAB_DUALPF_DISABLE} ;
  827.  
  828.  
  829. TYPE
  830.   PaletteExtra = RECORD    (* structure may be extended so watch out! *)
  831.     pe_Semaphore    : SignalSemaphore ;(* shared semaphore for arbitration*)
  832.     pe_FirstFree    : CARDINAL ; (* private *)
  833.     pe_NFree        : CARDINAL ; (* number of free colors *)
  834.     pe_FirstShared    : CARDINAL ; (* private *)
  835.     pe_NShared        : CARDINAL ; (* private *)
  836.     pe_RefCnt        : ADDRESS  ; (* private *)
  837.     pe_AllocList    : ADDRESS  ; (* private *)
  838.     pe_ViewPort        : ViewPortPtr ;    (* back pointer to viewport*)
  839.     pe_SharableColors    : CARDINAL ;    (* the number of sharable colors.*)
  840.   END ;
  841.  
  842. (* flags values for ObtainPen *)
  843. CONST
  844.   PENB_EXCLUSIVE    = 0 ;
  845.   PENB_NO_SETCOLOR    = 1 ;
  846.  
  847.   PENF_EXCLUSIVE    = {PENB_EXCLUSIVE} ;
  848.   PENF_NO_SETCOLOR    = {PENB_NO_SETCOLOR} ;
  849.  
  850.   (* obsolete names for PENF_xxx flags: *)
  851.  
  852.   PEN_EXCLUSIVE        = PENF_EXCLUSIVE ;
  853.   PEN_NO_SETCOLOR    = PENF_NO_SETCOLOR ;
  854.  
  855.   (* precision values for ObtainBestPen : *)
  856.  
  857.   PRECISION_EXACT    = -1 ;
  858.   PRECISION_IMAGE    = 0  ;
  859.   PRECISION_ICON    = 16 ;
  860.   PRECISION_GUI        = 32 ;
  861.  
  862.  
  863.   (* tags for ObtainBestPen: *)
  864.  
  865.   OBP_Precision = 084000000H ;
  866.   OBP_FailIfBad = 084000001H ;
  867.  
  868.   (* From V39, MakeVPort() will return an error if there is not enough memory,*)
  869.   (* or the requested mode cannot be opened with the requested depth with the *)
  870.   (* given bitmap (for higher bandwidth alignments).                  *)
  871.  
  872.   MVP_OK    = 0 ;    (* you want to see this one                  *)
  873.   MVP_NO_MEM    = 1 ;    (* insufficient memory for intermediate workspace     *)
  874.   MVP_NO_VPE    = 2 ;    (* ViewPort does not have a ViewPortExtra, and          *)
  875.             (* insufficient memory to allocate a temporary one.   *)
  876.  
  877.   MVP_NO_DSPINS    = 3 ;    (* insufficient memory for intermidiate copper   *)
  878.             (* instructions.                 *)
  879.  
  880.   MVP_NO_DISPLAY = 4 ;    (* BitMap data is misaligned for this viewport's *)
  881.             (* mode and depth - see AllocBitMap().         *)
  882.  
  883.   MVP_OFF_BOTTOM = 5 ;    (* PRIVATE - you will never see this. *)
  884.  
  885.   (* From V39, MrgCop() will return an error if there is not enough memory,
  886.    * or for some reason MrgCop() did not need to make any copper lists.
  887.    *)
  888.  
  889.   MCOP_OK    = 0 ;    (* you want to see this one            *)
  890.   MCOP_NO_MEM    = 1 ;    (* insufficient memory to allocate the system    *)
  891.             (* copper lists.                *)
  892.  
  893.   MCOP_NOP    = 2 ;    (* MrgCop() did not merge any copper lists    *)
  894.             (* (eg, no ViewPorts in the list, or all marked *)
  895.             (* as hidden).                    *)
  896.  
  897.  
  898. TYPE
  899.   DBufInfo = RECORD
  900.     dbi_Link1        : ADDRESS  ;
  901.     dbi_Count1        : LONGINT  ;
  902.     dbi_SafeMessage    : Message  ; (* replied to when safe to write to old *)
  903.                           (* bitmap                     *)
  904.     dbi_UserData1    : ADDRESS  ; (* first user data                 *)
  905.  
  906.     dbi_Link2        : ADDRESS  ;
  907.     dbi_Count2        : LONGINT  ;
  908.     dbi_DispMessage    : Message  ; (* replied to when new bitmap has been *)
  909.                           (* displayed at least once            *)
  910.     dbi_UserData2    : ADDRESS  ; (* second user data            *)
  911.     dbi_MatchLong    : LONGINT  ;
  912.     dbi_CopPtr1        : ADDRESS  ;
  913.     dbi_CopPtr2        : ADDRESS  ;
  914.     dbi_CopPtr3        : ADDRESS  ;
  915.     dbi_BeamPos1    : CARDINAL ;
  916.     dbi_BeamPos2    : CARDINAL ;
  917.   END ;
  918.  
  919.  
  920. (* These flags are passed (in combination) to CoerceMode() to determine the   *)
  921. (* type of coercion required.                              *)
  922.  
  923. CONST
  924.   PRESERVE_COLORS ={0}; (* Ensure that the mode coerced to can display just as*)
  925.                 (* many colours as the ViewPort being coerced          *)
  926.   AVOID_FLICKER      ={1}; (* Ensure that the mode coerced to is not interlaced  *)
  927.   IGNORE_MCOMPAT  ={2}; (* Coercion should ignore monitor compatibility issues*)
  928.   BIDTAG_COERCE      ={0}; (* Private                          *)
  929.  
  930.  
  931. (* These bit descriptors are used by the GEL collide routines.        *)
  932. (*  These bits are set in the hitMask and meMask variables of        *)
  933. (*  a GEL to describe whether or not these types of collisions        *)
  934. (*  can affect the GEL.  BNDRY_HIT is described further below;        *)
  935. (*  this bit is permanently assigned as the boundary-hit flag.        *)
  936. (*  The other bit GEL_HIT is meant only as a default to cover        *)
  937. (*  any GEL hitting any other; the user may redefine this bit.        *)
  938.  
  939. CONST
  940.   BORDERHIT = 0 ;
  941.  
  942. (* These bit descriptors are used by the GEL boundry hit routines.    *)
  943. (*  When the user's boundry-hit routine is called (via the argument    *)
  944. (*  set by a call to SetCollision) the first argument passed to        *)
  945. (*  the user's routine is the address of the GEL involved in the    *)
  946. (*  boundry-hit, and the second argument has the appropriate bit(s)    *)
  947. (*  set to describe which boundry was surpassed                *)
  948.  
  949.   TOPHIT    = 1 ;
  950.   BOTTOMHIT = 2 ;
  951.   LEFTHIT   = 4 ;
  952.   RIGHTHIT  = 8 ;
  953.  
  954.   COPPER_MOVE = 0 ;     (* pseude opcode for move #XXXX,dir        *)
  955.   COPPER_WAIT = 1 ;     (* pseudo opcode for wait y,x            *)
  956.   CPRNXTBUF   = 2 ;     (* continue processing with next buffer    *)
  957.   CPR_NT_LOF  = 08000H ; (* copper instruction only for short frames    *)
  958.   CPR_NT_SHT  = 04000H ; (* copper instruction only for long frames    *)
  959.   CPR_NT_SYS  = 02000H ; (* copper user instruction only        *)
  960.  
  961. TYPE
  962.   CopIns = RECORD
  963.     OpCode : INTEGER ; (* 0 = move, 1 = wait *)
  964.     CASE : LONGINT OF
  965.     |0: u3 :
  966.       RECORD
  967.         CASE : LONGINT OF
  968.         |0:nxtlist : CopListPtr ;
  969.         |1:u4:
  970.           RECORD
  971.             CASE :LONGINT OF
  972.             |0: u1 : RECORD
  973.                     VWaitPos: INTEGER;(* vertical beam wait              *)
  974.                     DestAddr: INTEGER;(* destination address of copper move*)
  975.              END ;
  976.         |1: u2 : RECORD
  977.                 HWaitPos: INTEGER;(* horizontal beam wait position     *)
  978.                DestData: INTEGER;(* destination immediate data to send*)
  979.              END ;
  980.         END ;
  981.       END ;
  982.         END ;
  983.       END ;
  984.       (* shorthand for above *)
  985.     |1: NXTLIST  : CopListPtr (* u3.nxtlist *)
  986.     |2: VWAITPOS , DESTADDR : INTEGER (* u3.u4.u1.field *)
  987.     |3: HWAITPOS , DESTDATA : INTEGER (* u3.u4.u2.field *)
  988.     END ;
  989.   END ;
  990.  
  991.   (* structure of cprlist that points to list that hardware actually executes *)
  992.  
  993.   cprlist = RECORD
  994.     Next     : cprlistPtr ;
  995.     start    : ADDRESS    ; (* start of copper list       *)
  996.     MaxCount : INTEGER    ; (* number of long instructions *)
  997.   END ;
  998.  
  999.   CopList = RECORD
  1000.     Next    : CopListPtr    ; (* next block for this copper list        *)
  1001.     _CopList    : CopListPtr    ; (* system use                    *)
  1002.     _ViewPort    : ViewPortPtr    ; (* system use                    *)
  1003.     CopIns    : CopInsPtr    ; (* start of this block            *)
  1004.     CopPtr    : CopInsPtr    ; (* intermediate ptr                *)
  1005.     CopLStart     : ADDRESS    ; (* mrgcop fills this in for Long Frame    *)
  1006.     CopSStart    : ADDRESS    ; (* mrgcop fills this in for Short Frame   *)
  1007.     Count    : INTEGER    ; (* intermediate counter            *)
  1008.     MaxCount    : INTEGER    ; (* max # of copins for this block        *)
  1009.     DyOffset    : INTEGER    ; (* offset this copper list vertical waits *)
  1010.     SLRepeat    : CARDINAL    ;
  1011.     Flags    : BITSET     ;
  1012.   END ;
  1013.  
  1014. CONST
  1015.   (* These CopList->Flags are private *)
  1016.   EXACT_LINE = {0} ;
  1017.   HALF_LINE  = {1} ;
  1018.  
  1019.  
  1020. TYPE
  1021.   UCopList = RECORD
  1022.     Next     : UCopListPtr ;
  1023.     FirstCopList : CopListPtr  ; (* head node of this copper list *)
  1024.     CopList     : CopListPtr  ; (* node in use              *)
  1025.   END ;
  1026.  
  1027. (* Private graphics data structure. This structure has changed in the past,   *)
  1028. (* and will continue to change in the future. Do Not Touch!              *)
  1029.  
  1030.  
  1031. TYPE
  1032.   copinit = RECORD
  1033.     vsync_hblank : ARRAY [0..1 ] OF CARDINAL ;
  1034.     diagstrt     : ARRAY [0..11] OF CARDINAL ;(*copper list for first bitplane*)
  1035.     fm0         : ARRAY [0..1 ] OF CARDINAL ;
  1036.     diwstart     : ARRAY [0..9 ] OF CARDINAL ;
  1037.     bplcon2     : ARRAY [0..1 ] OF CARDINAL ;
  1038.     sprfix     : ARRAY [0..15] OF CARDINAL ;
  1039.     sprstrtup     : ARRAY [0..31] OF CARDINAL ;
  1040.     wait14     : ARRAY [0..1 ] OF CARDINAL ;
  1041.     norm_hblank     : ARRAY [0..1 ] OF CARDINAL ;
  1042.     jump     : ARRAY [0..1 ] OF CARDINAL ;
  1043.     wait_forever : ARRAY [0..5 ] OF CARDINAL ;
  1044.     sprstop     : ARRAY [0..7 ] OF CARDINAL ;
  1045.   END ;
  1046.  
  1047. CONST
  1048.  
  1049.   (* bplcon0 defines *)
  1050.  
  1051.   MODE_640    = {15}    ;
  1052.   PLNCNTMSK   = {0..2}    ;    (* how many bit planes?            *)
  1053.                  (* 0 = none, 1->6 = 1->6, 7 = reserved    *)
  1054.   PLNCNTSHFT  = 12    ;    (* bits to shift for bplcon0        *)
  1055.   PF2PRI      = {6}    ;    (* bplcon2 bit                *)
  1056.   COLORON     = {9}    ;    (* disable color burst            *)
  1057.   DBLPF          = {10}    ;
  1058.   HOLDNMODIFY = {11}    ;
  1059.   INTERLACE   = {2}    ;    (* interlace mode for 400            *)
  1060.  
  1061.   (* bplcon1 defines *)
  1062.  
  1063.   PFA_FINE_SCROLL       = {0..3} ;
  1064.   PFB_FINE_SCROLL_SHIFT = 0004H  ;
  1065.   PF_FINE_SCROLL_MASK   = {0..3} ;
  1066.  
  1067.   (* display window start and stop defines *)
  1068.  
  1069.   DIW_HORIZ_POS        = {0..6}    ;  (* horizontal start/stop    *)
  1070.   DIW_VRTCL_POS        = {0..8}    ;  (* vertical start/stop    *)
  1071.   DIW_VRTCL_POS_SHIFT    = 7 ;
  1072.  
  1073.   (* Data fetch start/stop horizontal position *)
  1074.  
  1075.   DFTCH_MASK = {0..7} ;
  1076.  
  1077.   (* vposr bits *)
  1078.  
  1079.   VPOSRLOF = {15} ;
  1080.  
  1081. (*------ Font Styles ------------------------------------------------*)
  1082.  
  1083. CONST
  1084.   FS_NORMAL     = { }    ;    (* normal text (no style bits set)    *)
  1085.   FSB_UNDERLINED =  0    ;    (* underlined (under baseline)        *)
  1086.   FSF_UNDERLINED = {0}    ;
  1087.   FSB_BOLD     =  1    ;    (* bold face text (ORed w/ shifted)    *)
  1088.   FSF_BOLD     = {1}    ;
  1089.   FSB_ITALIC     =  2    ;     (* italic (slanted 1:2 right)        *)
  1090.   FSF_ITALIC     = {2}    ;
  1091.   FSB_EXTENDED     =  3     ;    (* extended face (wider than normal)    *)
  1092.   FSF_EXTENDED     = {3}    ;
  1093.  
  1094.   FSB_COLORFONT     =  6    ;    (* this uses ColorTextFont structure    *)
  1095.   FSF_COLORFONT     = {6}    ;
  1096.   FSB_TAGGED     =  7    ;    (* the TextAttr is really an TTextAttr, *)
  1097.   FSF_TAGGED     = {7}    ;
  1098.  
  1099. (*------ Font Flags -------------------------------------------------*)
  1100.  
  1101.   FPB_ROMFONT    =  0    ;    (* font is in rom             *)
  1102.   FPF_ROMFONT    = {0}    ;
  1103.   FPB_DISKFONT    =  1    ;    (* font is from diskfont.library     *)
  1104.   FPF_DISKFONT    = {1}    ;
  1105.   FPB_REVPATH    =  2    ;    (* designed path is reversed (e.g. left) *)
  1106.   FPF_REVPATH    = {2}    ;
  1107.   FPB_TALLDOT    =  3    ;    (* designed for hires non-interlaced     *)
  1108.   FPF_TALLDOT    = {3}    ;
  1109.   FPB_WIDEDOT    =  4    ;    (* designed for lores interlaced     *)
  1110.   FPF_WIDEDOT    = {4}    ;
  1111.   FPB_PROPORTIONAL =  5 ;    (* character sizes can vary from nominal *)
  1112.   FPF_PROPORTIONAL = {5};
  1113.   FPB_DESIGNED       =  6 ;    (* size explicitly designed, not constructed  *)
  1114.                 (* note: if you do not set this bit in your   *)
  1115.                   (* textattr, then a font may be constructed   *)
  1116.                 (* for you by scaling an existing rom or disk *)
  1117.                 (* font (under V36 and above).              *)
  1118.   FPF_DESIGNED  = {6} ;
  1119.     (* bit 7 is always clear for fonts on the graphics font list *)
  1120.   FPB_REMOVED    =  7  ;        (* the font has been removed              *)
  1121.   FPF_REMOVED    = {7} ;
  1122.  
  1123. (*------- TextAttr node, matches text attributes in RastPort ----------*)
  1124.  
  1125. TYPE
  1126.   TextAttr = RECORD
  1127.     ta_Name  : STRING   ; (* name of the font        *)
  1128.     ta_YSize : CARDINAL ; (* height of the font        *)
  1129.     ta_Style : SHORTSET ; (* intrinsic font style    *)
  1130.     ta_Flags : SHORTSET ; (* font preferences and flags    *)
  1131.   END ;
  1132.  
  1133.   TTextAttr = RECORD
  1134.     tta_Name  : STRING ;    (* name of the font        *)
  1135.     tta_YSize : CARDINAL ;    (* height of the font        *)
  1136.     tta_Style : SHORTSET ;    (* intrinsic font style        *)
  1137.     tta_Flags : SHORTSET ;    (* font preferences and flags    *)
  1138.     tta_Tags  : TagItemPtr ;    (* extended attributes        *)
  1139.   END ;
  1140.  
  1141.  
  1142. (*----- Text Tags --------------------------------------------------*)
  1143.  
  1144. CONST
  1145.   TA_DeviceDPI = 1+TAG_USER ;    (* Tag value is Point union:        *)
  1146.                 (* Hi word XDPI, Lo word YDPI        *)
  1147.   MAXFONTMATCHWEIGHT = 32767 ;    (* perfect match from WeighTAMatch    *)
  1148.  
  1149.  
  1150. (*----- TextFonts node ---------------------------------------------*)
  1151.  
  1152. TYPE
  1153.   TextFont  = RECORD
  1154.     CASE :LONGINT OF
  1155.     |0: n : Node ;
  1156.     tf_Extension: MsgPortPtr ;
  1157.     |1:
  1158.     tf_Message    : Message ;    (* reply message for font removal         *)
  1159.     END ;
  1160.                 (* font name in LN      \    used in this  *)
  1161.     tf_YSize    : CARDINAL ;    (* font height          |    order to best *)
  1162.     tf_Style    : SHORTSET ;    (* font style          |    match a font  *)
  1163.     tf_Flags    : SHORTSET ;    (* preferences and flags  /    request.         *)
  1164.     tf_XSize    : CARDINAL ;    (* nominal font width                 *)
  1165.     tf_Baseline    : CARDINAL ;    (* distance from the top of char to baseline *)
  1166.     tf_BoldSmear: CARDINAL ;    (* smear to affect a bold enhancement         *)
  1167.  
  1168.     tf_Accessors: CARDINAL ;    (* access count                     *)
  1169.  
  1170.     tf_LoChar    : SHORTCARD ;    (* the first character described here         *)
  1171.     tf_HiChar    : SHORTCARD ;    (* the last character described here         *)
  1172.     tf_CharData : ADDRESS ;    (* the bit character data             *)
  1173.  
  1174.     tf_Modulo    : CARDINAL ;    (* the row modulo for the strike font data   *)
  1175.     tf_CharLoc    : ADDRESS  ;    (* ptr to location data for the strike font  *)
  1176.                 (*   2 words: bit offset then size         *)
  1177.     tf_CharSpace: ADDRESS ;    (* ptr to words of proportional spacing data *)
  1178.     tf_CharKern : ADDRESS ;    (* ptr to words of kerning data             *)
  1179.   END ;
  1180.  
  1181.  
  1182. (*-----    tfe_Flags0 (partial definition) ----------------------------*)
  1183.  
  1184. CONST
  1185.   TE0B_NOREMFONT =  0  ; (* disallow RemFont for this font *)
  1186.   TE0F_NOREMFONT = {0} ;
  1187.  
  1188. TYPE
  1189.   TextFontExtension = RECORD        (* this structure is read-only        *)
  1190.     tfe_MatchWord    : CARDINAL ;    (* a magic cookie for the extension *)
  1191.     tfe_Flags0        : SHORTSET ;    (* (system private flags)        *)
  1192.     tfe_Flags1        : SHORTSET ;    (* (system private flags)        *)
  1193.     tfe_BackPtr        : TextFontPtr ;    (* validation of compilation        *)
  1194.     tfe_OrigReplyPort    : MsgPortPtr ;    (* original value in tf_Extension   *)
  1195.     tfe_Tags        : TagItemPtr ;    (* Text Tags for the font        *)
  1196.     tfe_OFontPatchS    : ADDRESS ;    (* (system private use)            *)
  1197.     tfe_OFontPatchK    : ADDRESS ;    (* (system private use)            *)
  1198.     (* this space is reserved for future expansion *)
  1199.   END ;
  1200.  
  1201. (*-----    ColorTextFont node -----------------------------------------*)
  1202. (*-----    ctf_Flags --------------------------------------------------*)
  1203.  
  1204. CONST
  1205.   CT_COLORMASK = {0..3}    ; (* mask to get to following color styles     *)
  1206.   CT_COLORFONT = {0}    ; (* color map contains designer's colors      *)
  1207.   CT_GREYFONT  = {1}    ; (* color map describes even-stepped           *)
  1208.               (* brightnesses from low to high           *)
  1209.   CT_ANTIALIAS = {2}    ; (* zero background thru fully saturated char *)
  1210.  
  1211.   CTB_MAPCOLOR =  0  ;      (* map ctf_FgColor to the rp_FgPen if it's   *)
  1212.   CTF_MAPCOLOR = {0} ;      (* is a valid color within ctf_Low..ctf_High *)
  1213.  
  1214. (*----- ColorFontColors --------------------------------------------*)
  1215.  
  1216. TYPE
  1217.   ColorFontColors = RECORD
  1218.     cfc_Reserved    : CARDINAL ; (* *must* be zero                  *)
  1219.     cfc_Count        : CARDINAL ; (* number of entries in cfc_ColorTable   *)
  1220.     cfc_ColorTable    : ADDRESS  ; (* 4 bit/component color map packed xRGB *)
  1221.   END ;
  1222.  
  1223. (*-----    ColorTextFont ----------------------------------------------*)
  1224.  
  1225.   ColorTextFont = RECORD
  1226.     ctf_TF        : TextFont  ;
  1227.     ctf_Flags        : BITSET    ; (* extended flags             *)
  1228.     ctf_Depth        : SHORTCARD ; (* number of bit planes         *)
  1229.     ctf_FgColor        : SHORTCARD ; (* color that is remapped to FgPen *)
  1230.     ctf_Low        : SHORTCARD ; (* lowest color represented here     *)
  1231.     ctf_High        : SHORTCARD ; (* highest color represented here  *)
  1232.     ctf_PlanePick    : SHORTCARD ; (* PlanePick ala Images         *)
  1233.     ctf_PlaneOnOff    : SHORTCARD ; (* PlaneOnOff ala Images         *)
  1234.     ctf_ColorFontColors : ColorFontColorsPtr ; (* colors for font     *)
  1235.     ctf_CharData    : ARRAY [0..7] OF ADDRESS ;
  1236.                     (*pointers to bit planes ala tf_CharData *)
  1237.   END ;
  1238.  
  1239. (*------- TextExtent node -------------------------------------------*)
  1240.  
  1241.   TextExtentRec = RECORD
  1242.     te_Width  : CARDINAL  ; (* same as TextLength *)
  1243.     te_Height : CARDINAL  ; (* same as tf_YSize      *)
  1244.     te_Extent : Rectangle ; (* relative to CP      *)
  1245.   END ;
  1246.  
  1247.  
  1248.   (* the "public" handle to a DisplayInfoRecord *)
  1249.  
  1250. TYPE
  1251.   DisplayInfoHandle = ADDRESS ;
  1252.  
  1253.   (* datachunk type identifiers *)
  1254.  
  1255. CONST
  1256.   DTAG_DISP = 080000000H ;
  1257.   DTAG_DIMS = 080001000H ;
  1258.   DTAG_MNTR = 080002000H ;
  1259.   DTAG_NAME = 080003000H ;
  1260.   DTAG_VEC  = 080004000H ; (* internal use only *)
  1261.  
  1262. TYPE
  1263.   QueryHeader = RECORD
  1264.     StructID  : LONGINT ; (* datachunk type identifier            *)
  1265.     DisplayID : LONGINT ; (* copy of display record key            *)
  1266.     SkipID    : LONGINT ; (* TAG_SKIP -- see tagitems.h            *)
  1267.     Length    : LONGINT ; (* length of local data in double-longwords    *)
  1268.   END ;
  1269.  
  1270.   DisplayInfo = RECORD
  1271.     Header        : QueryHeader ;
  1272.     NotAvailable    : CARDINAL ;    (* if NULL available, else see defines*)
  1273.     PropertyFlags    : LONGSET ;    (* Properties of this mode see defines*)
  1274.     Resolution        : Point ;    (* ticks-per-pixel X/Y              *)
  1275.     PixelSpeed        : CARDINAL ;    (* aproximation in nanoseconds          *)
  1276.     NumStdSprites    : CARDINAL ;    (* number of standard amiga sprites   *)
  1277.     PaletteRange    : CARDINAL ;    (* OBSOLETE - use Red/Green/Blue bits *)
  1278.                         (* instead                   *)
  1279.  
  1280.     SpriteResolution    : Point ; (* std sprite ticks-per-pixel X/Y    *)
  1281.     pad            : ARRAY [0..3] OF SHORTCARD ;
  1282.                         (* used internally              *)
  1283.     RedBits        : SHORTCARD ;    (* number of Red bits this display    *)
  1284.                         (* supports (V39)              *)
  1285.     GreenBits        : SHORTCARD ;    (* number of Green bits this display  *)
  1286.                         (* supports (V39)              *)
  1287.     BlueBits        : SHORTCARD ;    (* number of Blue bits this display   *)
  1288.                         (* supports (V39)              *)
  1289.     pad2        : SHORTCARD ;
  1290.     pad3        : ARRAY [0..3] OF SHORTCARD ;
  1291.                         (* find some use for this. *)
  1292.     reserved        : ARRAY [0..1] OF LONGINT ; (* terminator *)
  1293.   END ;
  1294.  
  1295. CONST
  1296. (* availability *)
  1297.  
  1298.   DI_AVAIL_NOCHIPS        = 00001 ;
  1299.   DI_AVAIL_NOMONITOR        = 00002 ;
  1300.   DI_AVAIL_NOTWITHGENLOCK    = 00004 ;
  1301.  
  1302. (* mode properties *)
  1303.  
  1304.   DIPF_IS_LACE        = {0} ;
  1305.   DIPF_IS_DUALPF    = {1} ;
  1306.   DIPF_IS_PF2PRI    = {2} ;
  1307.   DIPF_IS_HAM        = {3} ;
  1308.  
  1309.   DIPF_IS_ECS        = {4} ;    (* note: ECS modes (SHIRES, VGA, and *)
  1310.                 (* PRODUCTIVITY) do not support      *)
  1311.                 (* attached sprites.             *)
  1312.  
  1313.   DIPF_IS_AA        = {16} ;(* AA modes - may only be available  *)
  1314.                 (* if machine has correct memory     *)
  1315.                 (* type to support required         *)
  1316.                 (* bandwidth - check availability.   *)
  1317.                 (* (V39)                 *)
  1318.  
  1319.   DIPF_IS_PAL        = {5} ;
  1320.   DIPF_IS_SPRITES    = {6} ;
  1321.   DIPF_IS_GENLOCK    = {7} ;
  1322.  
  1323.   DIPF_IS_WB        = {8} ;
  1324.   DIPF_IS_DRAGGABLE    = {9} ;
  1325.   DIPF_IS_PANELLED    = {10} ;
  1326.   DIPF_IS_BEAMSYNC    = {11} ;
  1327.  
  1328.   DIPF_IS_EXTRAHALFBRITE = {12} ;
  1329.  
  1330. (* The following DIPF_IS_... flags are new for V39 *)
  1331.  
  1332.   DIPF_IS_SPRITES_ATT        = {13} ; (* supports attached sprites          *)
  1333.   DIPF_IS_SPRITES_CHNG_RES    = {14} ; (* supports variable sprite reslution*)
  1334.   DIPF_IS_SPRITES_BORDER    = {15} ; (* sprite can be displayed in the    *)
  1335.                        (* border                  *)
  1336.   DIPF_IS_SCANDBL        = {17} ; (* scan doubled              *)
  1337.   DIPF_IS_SPRITES_CHNG_BASE    = {18} ; (* can change the sprite base colour *)
  1338.   DIPF_IS_SPRITES_CHNG_PRI    = {19} ;
  1339.                     (* can change the sprite priority     *)
  1340.                     (* with respect to the playfield(s).  *)
  1341.  
  1342.   DIPF_IS_DBUFFER  = {20} ;    (* can support double buffering        *)
  1343.   DIPF_IS_PROGBEAM = {21} ;    (* is a programmed beam-sync mode    *)
  1344.   DIPF_IS_FOREIGN  = {31} ;    (* this mode is not native to the Amiga *)
  1345.  
  1346.  
  1347. TYPE
  1348.   DimensionInfo = RECORD
  1349.     Header        : QueryHeader ;
  1350.     MaxDepth        : CARDINAL  ; (* log2( max number of colors ) *)
  1351.     MinRasterWidth    : CARDINAL  ; (* minimum width in pixels      *)
  1352.     MinRasterHeight    : CARDINAL  ; (* minimum height in pixels     *)
  1353.     MaxRasterWidth    : CARDINAL  ; (* maximum width in pixels      *)
  1354.     MaxRasterHeight    : CARDINAL  ; (* maximum height in pixels     *)
  1355.     Nominal        : Rectangle ; (* "standard" dimensions          *)
  1356.     MaxOScan        : Rectangle ; (* fixed, hardware dependent    *)
  1357.     VideoOScan        : Rectangle ; (* fixed, hardware dependent    *)
  1358.     TxtOScan        : Rectangle ; (* editable via preferences     *)
  1359.     StdOScan        : Rectangle ; (* editable via preferences     *)
  1360.     pad            : ARRAY [0..13] OF SHORTCARD ;
  1361.     reserved        : ARRAY [0..1] OF LONGINT ; (* terminator *)
  1362.   END ;
  1363.  
  1364.   MonitorInfo = RECORD
  1365.     Header        : QueryHeader ;
  1366.     Mspc        : MonitorSpecPtr ;(* pointer to monitor specification *)
  1367.     ViewPosition    : Point ;      (* editable via preferences          *)
  1368.     ViewResolution    : Point ;         (* standard monitor ticks-per-pixel *)
  1369.     ViewPositionRange    : Rectangle ;     (* fixed, hardware dependent          *)
  1370.     TotalRows        : CARDINAL ;      (* display height in scanlines      *)
  1371.     TotalColorClocks    : CARDINAL ;      (* scanline width in 280 ns units   *)
  1372.     MinRow        : CARDINAL ;      (* absolute minimum active scanline *)
  1373.     Compatibility    : INTEGER ;      (* how this coexists with others    *)
  1374.     pad            : ARRAY [0..31] OF SHORTCARD ;
  1375.     MouseTicks        : Point ;
  1376.     DefaultViewPosition    : Point ;   (* original, never changes  *)
  1377.     PreferredModeID    : LONGINT ; (* for Preferences        *)
  1378.     reserved        : ARRAY [0..1] OF LONGINT ;
  1379.                         (* terminator        *)
  1380.   END ;
  1381.  
  1382. CONST
  1383. (* monitor compatibility *)
  1384.  
  1385.   MCOMPAT_MIXED    = 0 ;    (* can share display with other MCOMPAT_MIXED    *)
  1386.   MCOMPAT_SELF    = 1 ;    (* can share only within same monitor        *)
  1387.   MCOMPAT_NOBODY = -1 ;    (* only one viewport at a time            *)
  1388.  
  1389.   DISPLAYNAMELEN = 32 ;
  1390.  
  1391. TYPE
  1392.   NameInfo = RECORD
  1393.     Header   : QueryHeader ;
  1394.     Name     : ARRAY [0..DISPLAYNAMELEN-1] OF CHAR ;
  1395.     reserved : ARRAY [0..1] OF LONGINT ; (* terminator *)
  1396.   END ;
  1397.  
  1398. TYPE
  1399.   MonitorSpec = RECORD
  1400.     ms_Node            : ExtendedNode ;
  1401.     ms_Flags            : BITSET  ;
  1402.     ratioh             : LONGINT ;
  1403.     ratiov             : LONGINT ;
  1404.     total_rows             : CARDINAL ;
  1405.     total_colorclocks         : CARDINAL ;
  1406.     DeniseMaxDisplayColumn     : CARDINAL ;
  1407.     BeamCon0             : CARDINAL ;
  1408.     min_row             : CARDINAL ;
  1409.     ms_Special             : SpecialMonitorPtr ;
  1410.     ms_OpenCount         : CARDINAL ;
  1411.     ms_transform         : LongProc ;
  1412.     ms_translate         : LongProc ;
  1413.     ms_scale               : LongProc ;
  1414.     ms_xoffset             : CARDINAL ;
  1415.     ms_yoffset             : CARDINAL ;
  1416.     ms_LegalView         : Rectangle ;
  1417.     ms_maxoscan         : LongProc ;    (* maximum legal overscan *)
  1418.     ms_videoscan         : LongProc ;    (* video display overscan *)
  1419.     DeniseMinDisplayColumn    : CARDINAL ;
  1420.     DisplayCompatible        : LONGINT ;
  1421.     DisplayInfoDataBase        : List ;
  1422.     DisplayInfoDataBaseSemaphore: SignalSemaphore ;
  1423.     ms_MrgCop            : LongProc ;
  1424.     ms_LoadView            : LongProc ;
  1425.     ms_KillView            : LongProc ;
  1426.   END ;
  1427.  
  1428. CONST
  1429.   TO_MONITOR        = 0 ;
  1430.   FROM_MONITOR        = 1 ;
  1431.   STANDARD_XOFFSET    = 9 ;
  1432.   STANDARD_YOFFSET    = 0 ;
  1433.  
  1434.   MSB_REQUEST_NTSC    = 0 ;
  1435.   MSB_REQUEST_PAL    = 1 ;
  1436.   MSB_REQUEST_SPECIAL    = 2 ;
  1437.   MSB_REQUEST_A2024    = 3 ;
  1438.   MSB_DOUBLE_SPRITES    = 4 ;
  1439.  
  1440.   MSF_REQUEST_NTSC    = {MSB_REQUEST_NTSC} ;
  1441.   MSF_REQUEST_PAL    = {MSB_REQUEST_PAL} ;
  1442.   MSF_REQUEST_SPECIAL    = {MSB_REQUEST_SPECIAL} ;
  1443.   MSF_REQUEST_A2024    = {MSB_REQUEST_A2024} ;
  1444.   MSF_DOUBLE_SPRITES    = {MSB_DOUBLE_SPRITES} ;
  1445.  
  1446.  
  1447. (* obsolete, v37 compatible definitions follow *)
  1448.  
  1449.   REQUEST_NTSC        = {MSB_REQUEST_NTSC} ;
  1450.   REQUEST_PAL        = {MSB_REQUEST_PAL} ;
  1451.   REQUEST_SPECIAL    = {MSB_REQUEST_SPECIAL} ;
  1452.   REQUEST_A2024        = {MSB_REQUEST_A2024} ;
  1453.  
  1454.   DEFAULT_MONITOR_NAME    = "default.monitor" ;
  1455.   NTSC_MONITOR_NAME    = "ntsc.monitor" ;
  1456.   PAL_MONITOR_NAME    = "pal.monitor" ;
  1457.   STANDARD_MONITOR_MASK    = ( REQUEST_NTSC + REQUEST_PAL ) ;
  1458.  
  1459.   STANDARD_NTSC_ROWS    = 262 ;
  1460.   STANDARD_PAL_ROWS    = 312 ;
  1461.   STANDARD_COLORCLOCKS    = 226 ;
  1462.   STANDARD_DENISE_MAX    = 455 ;
  1463.   STANDARD_DENISE_MIN    = 93 ;
  1464.   STANDARD_NTSC_BEAMCON    = 00000 ;
  1465.   STANDARD_PAL_BEAMCON    = DISPLAYPAL ;
  1466.  
  1467.   SPECIAL_BEAMCON=VARVBLANK+LOLDIS+VARVSYNC+VARHSYNC+VARBEAM+CSBLANK+VSYNCTRUE ;
  1468.  
  1469.   MIN_NTSC_ROW        = 21 ;
  1470.   MIN_PAL_ROW        = 29 ;
  1471.   STANDARD_VIEW_X    = 081H ;
  1472.   STANDARD_VIEW_Y    = 02CH ;
  1473.   STANDARD_HBSTRT    = 006H ;
  1474.   STANDARD_HSSTRT    = 00BH ;
  1475.   STANDARD_HSSTOP    = 01CH ;
  1476.   STANDARD_HBSTOP    = 02CH ;
  1477.   STANDARD_VBSTRT    = 00122H ;
  1478.   STANDARD_VSSTRT    = 002A6H ;
  1479.   STANDARD_VSSTOP    = 003AAH ;
  1480.   STANDARD_VBSTOP    = 01066H ;
  1481.  
  1482.   VGA_COLORCLOCKS    = (STANDARD_COLORCLOCKS/2) ;
  1483.   VGA_TOTAL_ROWS    = (STANDARD_NTSC_ROWS*2) ;
  1484.   VGA_DENISE_MIN    = 59 ;
  1485.   MIN_VGA_ROW        = 29 ;
  1486.   VGA_HBSTRT        = 008H ;
  1487.   VGA_HSSTRT        = 00EH ;
  1488.   VGA_HSSTOP        = 01CH ;
  1489.   VGA_HBSTOP        = 01EH ;
  1490.   VGA_VBSTRT        = 00000H ;
  1491.   VGA_VSSTRT        = 00153H ;
  1492.   VGA_VSSTOP        = 00235H ;
  1493.   VGA_VBSTOP        = 00CCDH ;
  1494.  
  1495.   VGA_MONITOR_NAME    = "vga.monitor" ;
  1496.  
  1497.   BROADCAST_HBSTRT    = 001H ;
  1498.   BROADCAST_HSSTRT    = 006H ;
  1499.   BROADCAST_HSSTOP    = 017H ;
  1500.   BROADCAST_HBSTOP    = 027H ;
  1501.   BROADCAST_VBSTRT    = 00000H ;
  1502.   BROADCAST_VSSTRT    = 002A6H ;
  1503.   BROADCAST_VSSTOP    = 0054CH ;
  1504.   BROADCAST_VBSTOP    = 01C40H ;
  1505.   BROADCAST_BEAMCON    = LOLDIS + CSBLANK ;
  1506.   RATIO_FIXEDPART    = 4 ;
  1507.   RATIO_UNITY        = INTEGER({RATIO_FIXEDPART}) ;
  1508.  
  1509. TYPE
  1510.   AnalogSignalInterval = RECORD
  1511.     asi_Start : CARDINAL ;
  1512.     asi_Stop  : CARDINAL ;
  1513.   END ;
  1514.  
  1515.   SpecialMonitor = RECORD
  1516.     spm_Node    : ExtendedNode ;
  1517.     spm_Flags     : BITSET  ;
  1518.     do_monitor    : LongProc ;
  1519.     reserved1    : LongProc ;
  1520.     reserved2    : LongProc ;
  1521.     reserved3    : LongProc ;
  1522.     hblank    : AnalogSignalInterval ;
  1523.     vblank    : AnalogSignalInterval ;
  1524.     hsync    : AnalogSignalInterval ;
  1525.     vsync    : AnalogSignalInterval ;
  1526.   END ;
  1527.  
  1528. CONST
  1529.   VTAG_END_CM            = 000000000H ;
  1530.   VTAG_CHROMAKEY_CLR        = 080000000H ;
  1531.   VTAG_CHROMAKEY_SET        = 080000001H ;
  1532.   VTAG_BITPLANEKEY_CLR        = 080000002H ;
  1533.   VTAG_BITPLANEKEY_SET        = 080000003H ;
  1534.   VTAG_BORDERBLANK_CLR        = 080000004H ;
  1535.   VTAG_BORDERBLANK_SET        = 080000005H ;
  1536.   VTAG_BORDERNOTRANS_CLR    = 080000006H ;
  1537.   VTAG_BORDERNOTRANS_SET    = 080000007H ;
  1538.   VTAG_CHROMA_PEN_CLR        = 080000008H ;
  1539.   VTAG_CHROMA_PEN_SET        = 080000009H ;
  1540.   VTAG_CHROMA_PLANE_SET        = 08000000AH ;
  1541.   VTAG_ATTACH_CM_SET        = 08000000BH ;
  1542.   VTAG_NEXTBUF_CM        = 08000000CH ;
  1543.   VTAG_BATCH_CM_CLR        = 08000000DH ;
  1544.   VTAG_BATCH_CM_SET        = 08000000EH ;
  1545.   VTAG_NORMAL_DISP_GET        = 08000000FH ;
  1546.   VTAG_NORMAL_DISP_SET        = 080000010H ;
  1547.   VTAG_COERCE_DISP_GET        = 080000011H ;
  1548.   VTAG_COERCE_DISP_SET        = 080000012H ;
  1549.   VTAG_VIEWPORTEXTRA_GET    = 080000013H ;
  1550.   VTAG_VIEWPORTEXTRA_SET    = 080000014H ;
  1551.   VTAG_CHROMAKEY_GET        = 080000015H ;
  1552.   VTAG_BITPLANEKEY_GET        = 080000016H ;
  1553.   VTAG_BORDERBLANK_GET        = 080000017H ;
  1554.   VTAG_BORDERNOTRANS_GET    = 080000018H ;
  1555.   VTAG_CHROMA_PEN_GET        = 080000019H ;
  1556.   VTAG_CHROMA_PLANE_GET        = 08000001AH ;
  1557.   VTAG_ATTACH_CM_GET        = 08000001BH ;
  1558.   VTAG_BATCH_CM_GET        = 08000001CH ;
  1559.   VTAG_BATCH_ITEMS_GET        = 08000001DH ;
  1560.   VTAG_BATCH_ITEMS_SET        = 08000001EH ;
  1561.   VTAG_BATCH_ITEMS_ADD        = 08000001FH ;
  1562.   VTAG_VPMODEID_GET        = 080000020H ;
  1563.   VTAG_VPMODEID_SET        = 080000021H ;
  1564.   VTAG_VPMODEID_CLR        = 080000022H ;
  1565.   VTAG_USERCLIP_GET        = 080000023H ;
  1566.   VTAG_USERCLIP_SET        = 080000024H ;
  1567.   VTAG_USERCLIP_CLR        = 080000025H ;
  1568.  
  1569. (* The following tags are V39 specific. They will be ignored *)
  1570. (* (returing error -3) by earlier versions             *)
  1571.  
  1572.   VTAG_PF1_BASE_GET        = 080000026H ;
  1573.   VTAG_PF2_BASE_GET        = 080000027H ;
  1574.   VTAG_SPEVEN_BASE_GET        = 080000028H ;
  1575.   VTAG_SPODD_BASE_GET        = 080000029H ;
  1576.   VTAG_PF1_BASE_SET        = 08000002AH ;
  1577.   VTAG_PF2_BASE_SET        = 08000002BH ;
  1578.   VTAG_SPEVEN_BASE_SET        = 08000002CH ;
  1579.   VTAG_SPODD_BASE_SET        = 08000002DH ;
  1580.   VTAG_BORDERSPRITE_GET        = 08000002EH ;
  1581.   VTAG_BORDERSPRITE_SET        = 08000002FH ;
  1582.   VTAG_BORDERSPRITE_CLR        = 080000030H ;
  1583.   VTAG_SPRITERESN_SET        = 080000031H ;
  1584.   VTAG_SPRITERESN_GET        = 080000032H ;
  1585.   VTAG_PF1_TO_SPRITEPRI_SET    = 080000033H ;
  1586.   VTAG_PF1_TO_SPRITEPRI_GET    = 080000034H ;
  1587.   VTAG_PF2_TO_SPRITEPRI_SET    = 080000035H ;
  1588.   VTAG_PF2_TO_SPRITEPRI_GET    = 080000036H ;
  1589.   VTAG_IMMEDIATE        = 080000037H ;
  1590.   VTAG_FULLPALETTE_SET        = 080000038H ;
  1591.   VTAG_FULLPALETTE_GET        = 080000039H ;
  1592.   VTAG_FULLPALETTE_CLR        = 08000003AH ;
  1593.   VTAG_DEFSPRITERESN_SET    = 08000003BH ;
  1594.   VTAG_DEFSPRITERESN_GET    = 08000003CH ;
  1595.  
  1596.   (* all the following tags follow the new, rational standard for videocontrol*)
  1597.   (* tags:                                      *)
  1598.   (* VC_xxx,state    set the state of attribute 'xxx' to value 'state'     *)
  1599.   (* VC_xxx_QUERY,&var    get the state of attribute 'xxx' and store it into the*)
  1600.   (*            longword pointed to by &var.                  *)
  1601.   (*                                          *)
  1602.   (* The following are new for V40:                          *)
  1603.  
  1604.   VC_IntermediateCLUpdate    = 080000080H ;
  1605.   (* default=true. When set graphics will update the intermediate copper   *)
  1606.   (* lists on color changes, etc. When false,it won't, and will be faster. *)
  1607.  
  1608.   VC_IntermediateCLUpdate_Query    = 080000081H ;
  1609.  
  1610.   VC_NoColorPaletteLoad        = 080000082H ;
  1611.  
  1612.   (* default = false. When set, graphics will only load color 0        *)
  1613.   (* for this ViewPort, and so the ViewPort's colors will come        *)
  1614.   (* from the previous ViewPort's.                    *)
  1615.   (*                                    *)
  1616.   (* NB - Using this tag and VTAG_FULLPALETTE_SET together is undefined.*)
  1617.  
  1618.   VC_NoColorPaletteLoad_Query    = 080000083H ;
  1619.  
  1620.   VC_DUALPF_Disable        = 080000084H ;
  1621.  
  1622.   (* default = false. When this flag is set, the dual-pf bit         *)
  1623.   (* in Dual-Playfield screens will be turned off. Even bitplanes     *)
  1624.   (* will still come from the first BitMap and odd bitplanes         *)
  1625.   (* from the second BitMap, and both R[xy]Offsets will be         *)
  1626.   (* considered. This can be used (with appropriate palette         *)
  1627.   (* selection) for cross-fades between differently scrolling         *)
  1628.   (* images.                                 *)
  1629.   (* When this flag is turned on, colors will be loaded for         *)
  1630.   (* the viewport as if it were a single viewport of depth depth1+depth2 *)
  1631.  
  1632.   VC_DUALPF_Disable_Query    = 080000085H ;
  1633.  
  1634.  
  1635.  
  1636. TYPE
  1637.   GfxBaseRec = RECORD
  1638.     LibNode        : Library ;
  1639.     ActiView        : ViewPtr ;
  1640.     copinit        : copinitPtr ;    (* ptr to copper start up list       *)
  1641.     cia            : ADDRESS ;    (* for 8520 resource use       *)
  1642.     blitter        : ADDRESS ;    (* for future blitter resource use *)
  1643.     LOFlist        : ADDRESS ;
  1644.     SHFlist        : ADDRESS ;
  1645.     blthd        : bltnodePtr ;
  1646.     blttl         : bltnodePtr ;
  1647.     bsblthd        : bltnodePtr ;
  1648.     bsblttl         : bltnodePtr ;
  1649.     vbsrv,timsrv,bltsrv    : Interrupt ;
  1650.     TextFonts        : List ;
  1651.     DefaultFont     : TextFontPtr ;
  1652.     Modes        : BITSET  ;    (* copy of current first bplcon0 *)
  1653.     VBlank        : SHORTINT ;
  1654.     Debug        : SHORTINT ;
  1655.     BeamSync        : INTEGER ;
  1656.     system_bplcon0    : BITSET  ;(* it is ored into each bplcon0 for display*)
  1657.     SpriteReserved    : SHORTCARD ;
  1658.     bytereserved    : SHORTCARD ;
  1659.     Flags        : BITSET  ;
  1660.     BlitLock        : INTEGER ;
  1661.     BlitNest        : INTEGER ;
  1662.  
  1663.     BlitWaitQ        : List ;
  1664.     BlitOwner        : TaskPtr ;
  1665.     TOF_WaitQ        : List ;
  1666.     DisplayFlags    : BITSET  ;    (* NTSC PAL GENLOC etc         *)
  1667.                     (* flags initialized at power on *)
  1668.     SimpleSprite    : POINTER TO ARRAY OF SimpleSpritePtr ;
  1669.     MaxDisplayRow    : CARDINAL ;    (* hardware stuff, do not use     *)
  1670.     MaxDisplayColumn    : CARDINAL ;    (* hardware stuff, do not use     *)
  1671.     NormalDisplayRows    : CARDINAL ;
  1672.     NormalDisplayColumns: CARDINAL ;
  1673.  
  1674.     (* the following are for standard non interlace, 1/2 wb width *)
  1675.  
  1676.     NormalDPMX        : CARDINAL ;    (* Dots per meter on display *)
  1677.     NormalDPMY        : CARDINAL ;    (* Dots per meter on display *)
  1678.     LastChanceMemory    : SignalSemaphorePtr ;
  1679.     LCMptr        : ADDRESS ;
  1680.     MicrosPerLine    : CARDINAL ;    (* 256 time usec/line *)
  1681.     MinDisplayColumn    : CARDINAL ;
  1682.  
  1683.     ChipRevBits0    : SHORTSET ;
  1684.     MemType        : SHORTSET ;
  1685.     crb_reserved    : ARRAY [0..3] OF SHORTCARD ;
  1686.     monitor_id        : CARDINAL ;
  1687.     hedley        : ARRAY [0..7] OF LONGINT ;
  1688.     hedley_sprites    : ARRAY [0..7] OF LONGINT ;
  1689.                     (* sprite ptrs for intuition mouse *)
  1690.     hedley_sprites1    : ARRAY [0..7] OF LONGINT ;
  1691.                     (* sprite ptrs for intuition mouse *)
  1692.     edley_count        : INTEGER ;
  1693.     hedley_flags    : BITSET  ;
  1694.     edley_tmp        : INTEGER ;
  1695.     hash_table        : ADDRESS ;
  1696.     current_tot_rows    : CARDINAL ;
  1697.     current_tot_cclks    : CARDINAL ;
  1698.     hedley_hint        : SHORTCARD ;
  1699.     hedley_hint2    : SHORTCARD ;
  1700.     nreserved        : ARRAY [0..3] OF LONGINT ;
  1701.     a2024_sync_raster    : ADDRESS ;
  1702.     control_delta_pal    : CARDINAL ;
  1703.     control_delta_ntsc    : CARDINAL ;
  1704.     current_monitor    : MonitorSpecPtr ;
  1705.     MonitorList        : List ;
  1706.     default_monitor    : MonitorSpecPtr ;
  1707.     MonitorListSemaphore: SignalSemaphorePtr ;
  1708.     DisplayInfoDataBase : ADDRESS ;
  1709.     TopLine        : CARDINAL ;
  1710.     ActiViewCprSemaphore: SignalSemaphorePtr ;
  1711.     UtilBase        : ADDRESS ; (* for hook and tag utilities. had to *)
  1712.                         (* change because of name clash      *)
  1713.     ExecBase        : ADDRESS ; (* to link with rom.lib          *)
  1714.  
  1715.     bwshifts        : ADDRESS ;
  1716.     StrtFetchMasks    : ADDRESS ;
  1717.     StopFetchMasks    : ADDRESS ;
  1718.     Overrun        : ADDRESS ;
  1719.     ealStops        : ADDRESS ;
  1720.     SpriteWidth        : CARDINAL ;  (* current width (in words) of sprites  *)
  1721.     SpriteFMode        : BITSET   ;  (* current sprite fmode bits          *)
  1722.     SoftSprites        : SHORTSET ;  (* bit mask of size change knowledgeable*)
  1723.                           (* sprites                  *)
  1724.     arraywidth        : SHORTINT ;
  1725.     DefaultSpriteWidth    : CARDINAL ;  (* what width intuition wants *)
  1726.     SprMoveDisable    : SHORTSET ;
  1727.     WantChips        : SHORTSET ;
  1728.     BoardMemType    : SHORTSET ;
  1729.     Bugs        : SHORTSET ;
  1730.     gb_LayersBase    : ADDRESS ;
  1731.     ColorMask        : LONGSET ;
  1732.     IVector        : ADDRESS ;
  1733.     IData        : ADDRESS ;
  1734.     SpecialCounter    : LONGINT ;   (* special for double buffering *)
  1735.     DBList        : ADDRESS ;
  1736.     MonitorFlags    : BITSET  ;
  1737.     ScanDoubledSprites  : SHORTCARD ;
  1738.     BP3Bits        : SHORTSET ;
  1739.     MonitorVBlank    : AnalogSignalInterval ;
  1740.     natural_monitor    : MonitorSpecPtr ;
  1741.  
  1742.     ProgData        : ADDRESS ;
  1743.     ExtSprites        : SHORTCARD ;
  1744.     pad3        : SHORTCARD ;
  1745.     GfxFlags        : BITSET  ;
  1746.     VBCounter        : LONGINT ;
  1747.     HashTableSemaphore    : SignalSemaphorePtr ;
  1748.     CASE :LONGINT OF
  1749.     |0: ChunkyToPlanarPtr : LONGINT ;
  1750.     |1: HWEmul : ARRAY [0..8] OF LONGINT ;
  1751.     END ;
  1752.   END ;
  1753.  
  1754. VAR
  1755.   GfxBase : GfxBasePtr ;
  1756.  
  1757. CONST
  1758.   GRAPHICSNAME = "graphics.library" ;
  1759.  
  1760.   (* Values for GfxBase->DisplayFlags *)
  1761.  
  1762.   NTSC        = {0} ;
  1763.   GENLOC    = {1} ;
  1764.   PAL        = {2} ;
  1765.   TODA_SAFE    = {3} ;
  1766.   REALLY_PAL    = {4} ;    (* what is actual crystal frequency              *)
  1767.             (*(as opposed to what bootmenu set the agnus to)?(V39)*)
  1768.  
  1769.   LPEN_SWAP_FRAMES = {5} ;
  1770.  
  1771.   (* LightPen software could set this bit if the            *)
  1772.   (* "lpen-with-interlace" fix put in for V39                *)
  1773.   (* does not work. This is true of a number of Agnus chips. (V40). *)
  1774.  
  1775.   BLITMSG_FAULT    = {2} ;
  1776.  
  1777.   (* bits defs for ChipRevBits *)
  1778.  
  1779.   GFXB_BIG_BLITS    = 0 ;
  1780.   GFXB_HR_AGNUS        = 0 ;
  1781.  
  1782.   GFXB_HR_DENISE    = 1 ;
  1783.   GFXB_AA_ALICE        = 2 ;
  1784.   GFXB_AA_LISA        = 3 ;
  1785.   GFXB_AA_MLISA        = 4 ;    (* internal use only. *)
  1786.  
  1787.   GFXF_BIG_BLITS    = {0} ;
  1788.   GFXF_HR_AGNUS        = {0} ;
  1789.   GFXF_HR_DENISE    = {1} ;
  1790.   GFXF_AA_ALICE        = {2} ;
  1791.   GFXF_AA_LISA        = {3} ;
  1792.   GFXF_AA_MLISA        = {4} ;    (* internal use only *)
  1793.  
  1794.   (* Pass ONE of these to SetChipRev() *)
  1795.  
  1796.   SETCHIPREV_A        = GFXF_HR_AGNUS ;
  1797.   SETCHIPREV_ECS    = GFXF_HR_AGNUS + GFXF_HR_DENISE ;
  1798.   SETCHIPREV_AA        = GFXF_AA_ALICE + GFXF_AA_LISA + SETCHIPREV_ECS ;
  1799.   SETCHIPREV_BEST    = {0..31} ;
  1800.  
  1801.   (* memory type *)
  1802.  
  1803.   BUS_16        = {} ;
  1804.   NML_CAS        = {} ;
  1805.   BUS_32        = {0} ;
  1806.   DBL_CAS        = {1} ;
  1807.  
  1808.   BANDWIDTH_1X        = BUS_16 + NML_CAS ;
  1809.   BANDWIDTH_2XNML    = BUS_32 ;
  1810.   BANDWIDTH_2XDBL    = DBL_CAS ;
  1811.   BANDWIDTH_4X        = BUS_32 + DBL_CAS ;
  1812.  
  1813.   (* GfxFlags (private) *)
  1814.  
  1815.   NEW_DATABASE        = {0} ;
  1816.  
  1817. CONST
  1818.   BITSET = BITSET(08000H) ;
  1819.   BITCLR = { } ;
  1820.  
  1821. (*------------------------- BitMap primitives --------------------------------*)
  1822.  
  1823. PROCEDURE BltBitMap( srcBitMap : BitMapPtr ;
  1824.              xSrc      : LONGINT ;
  1825.              ySrc      : LONGINT ;
  1826.              destBitMap: BitMapPtr ;
  1827.              xDest     : LONGINT ;
  1828.              yDest     : LONGINT ;
  1829.              xSize     : LONGINT ;
  1830.              ySize     : LONGINT ;
  1831.              minterm   : LONGINT ;
  1832.              mask      : LONGINT ;
  1833.              tempA     : PLANEPTR ) : LONGINT ;
  1834.  
  1835. PROCEDURE BltTemplate( source : PLANEPTR ;
  1836.                xSrc   : LONGINT ;
  1837.                srcMod : LONGINT ;
  1838.                destRP : RastPortPtr ;
  1839.                xDest  : LONGINT ;
  1840.                yDest  : LONGINT ;
  1841.                xSize  : LONGINT ;
  1842.                ySize  : LONGINT ) ;
  1843.  
  1844. (*------------------------ Text routines -------------------------------------*)
  1845.  
  1846. PROCEDURE ClearEOL   ( rp : RastPortPtr ) ;
  1847. PROCEDURE ClearScreen( rp : RastPortPtr ) ;
  1848.  
  1849. PROCEDURE TextLength( rp     : RastPortPtr ;
  1850.               string : STRING ;
  1851.               count  : LONGINT ) : INTEGER ;
  1852.  
  1853. PROCEDURE Text( rp     : RastPortPtr ;
  1854.         string : STRING ;
  1855.         count  : LONGINT ) : LONGINT ;
  1856.  
  1857. PROCEDURE SetFont( rp : RastPortPtr ; textFont : TextFontPtr ) : LONGINT ;
  1858.  
  1859. PROCEDURE OpenFont( textAttr : TextAttrPtr ) : TextFontPtr ;
  1860.  
  1861. PROCEDURE CloseFont( textFont : TextFontPtr ) ;
  1862. PROCEDURE AskSoftStyle( rp : RastPortPtr ) : SHORTSET ;
  1863. PROCEDURE SetSoftStyle( rp     : RastPortPtr ;
  1864.                 style  : SHORTSET ;
  1865.                 enable : SHORTSET ) : SHORTSET ;
  1866.  
  1867. (*------------------------- Gels routines ------------------------------------*)
  1868.  
  1869. PROCEDURE AddBob( bob : BobPtr ; rp : RastPortPtr ) ;
  1870. PROCEDURE AddVSprite( vSprite : VSpritePtr ; rp : RastPortPtr ) ;
  1871. PROCEDURE DoCollision( rp : RastPortPtr ) ;
  1872. PROCEDURE DrawGList( rp : RastPortPtr ; vp : ViewPortPtr ) ;
  1873.  
  1874. PROCEDURE InitGels( head : VSpritePtr ;
  1875.             tail : VSpritePtr ;
  1876.             gelsInfo : GelsInfoPtr ) ;
  1877.  
  1878. PROCEDURE InitMasks( vSprite : VSpritePtr ) ;
  1879.  
  1880. PROCEDURE RemIBob( bob : BobPtr ;
  1881.            rp  : RastPortPtr ;
  1882.            vp  : ViewPortPtr ) ;
  1883.  
  1884. PROCEDURE RemVSprite( vSprite : VSpritePtr );
  1885.  
  1886. PROCEDURE SetCollision( num     : LONGINT ;
  1887.             cp     : PROC ; (* cast it *)
  1888.             gelsInfo : GelsInfoPtr ) ;
  1889.  
  1890. PROCEDURE SortGList( rp : RastPortPtr ) ;
  1891.  
  1892. PROCEDURE AddAnimOb( anOb  : AnimObPtr ;
  1893.              anKey : ADDRESS ;
  1894.              rp    : RastPortPtr ) ;
  1895.  
  1896. PROCEDURE Animate( VAR anKey : AnimOb ; rp : RastPortPtr ) ;
  1897.  
  1898. PROCEDURE GetGBuffers( anOb : AnimObPtr ;
  1899.                rp   : RastPortPtr ;
  1900.                flag : LONGINT ) : BOOLEAN ;
  1901.  
  1902. PROCEDURE InitGMasks( anOb : AnimObPtr ) ;
  1903.  
  1904. (*-------------------- General graphics routines -----------------------------*)
  1905.  
  1906. PROCEDURE DrawEllipse( rp      : RastPortPtr ;
  1907.                xCenter : LONGINT ;
  1908.                yCenter : LONGINT ;
  1909.                a       : LONGINT ;
  1910.                b       : LONGINT ) ;
  1911.  
  1912. PROCEDURE AreaEllipse( rp      : RastPortPtr  ;
  1913.                xCenter : LONGINT ;
  1914.                yCenter : LONGINT ;
  1915.                a       : LONGINT ;
  1916.                b       : LONGINT ) : LONGINT ;
  1917.  
  1918. PROCEDURE LoadRGB4( vp : ViewPortPtr ; colors : ADDRESS ; count : LONGINT ) ;
  1919. PROCEDURE InitRastPort( VAR rp : RastPort ) ;
  1920. PROCEDURE InitVPort( VAR vp : ViewPort ) ;
  1921. PROCEDURE MrgCop( view : ViewPtr ) : LONGINT ;
  1922. PROCEDURE MakeVPort( view : ViewPtr ; vp : ViewPortPtr ) : LONGINT ;
  1923. PROCEDURE LoadView( view : ViewPtr ) ;
  1924. PROCEDURE WaitBlit( ) ;
  1925. PROCEDURE SetRast( rp : RastPortPtr ; pen : LONGINT ) ;
  1926. PROCEDURE Move( rp : RastPortPtr ; x : LONGINT ; y : LONGINT ) ;
  1927. PROCEDURE Draw( rp : RastPortPtr ; x : LONGINT ; y : LONGINT ) ;
  1928. PROCEDURE AreaMove( rp : RastPortPtr ; x : LONGINT ; y : LONGINT ) : LONGINT ;
  1929. PROCEDURE AreaDraw( rp : RastPortPtr ; x : LONGINT ; y : LONGINT ) : LONGINT ;
  1930. PROCEDURE AreaEnd( rp : RastPortPtr ) : LONGINT ;
  1931. PROCEDURE WaitTOF( ) ;
  1932. PROCEDURE QBlit( blit : bltnodePtr ) ;
  1933.  
  1934. PROCEDURE InitArea( VAR areaInfo : AreaInfo ;
  1935.             vectorBuffer : ADDRESS ;
  1936.             maxVectors   : LONGINT ) ;
  1937.  
  1938. PROCEDURE SetRGB4( vp     : ViewPortPtr ;
  1939.            index : LONGINT ;
  1940.            red   : LONGINT ;
  1941.            green : LONGINT ;
  1942.            blue  : LONGINT ) ;
  1943.  
  1944. PROCEDURE QBSBlit( blit : bltnodePtr ) ;
  1945.  
  1946. PROCEDURE BltClear( memBlock  : PLANEPTR ;
  1947.             byteCount : LONGINT  ;
  1948.             flags     : LONGSET ) ;
  1949.  
  1950. PROCEDURE RectFill( rp : RastPortPtr ; xMin, yMin, xMax, yMax : LONGINT ) ;
  1951.  
  1952. PROCEDURE BltPattern( rp   : RastPortPtr ;
  1953.               mask : PLANEPTR ;
  1954.               xMin : LONGINT ;
  1955.               yMin : LONGINT ;
  1956.               xMax : LONGINT ;
  1957.               yMax : LONGINT ;
  1958.               maskBPR : LONGINT ) ;
  1959.  
  1960. PROCEDURE ReadPixel ( rp : RastPortPtr ; x : LONGINT ; y : LONGINT ) : LONGINT ;
  1961. PROCEDURE WritePixel( rp : RastPortPtr ; x : LONGINT ; y : LONGINT ) : LONGINT ;
  1962.  
  1963. PROCEDURE Flood( rp : RastPortPtr ;
  1964.          mode : LONGINT ;
  1965.          x, y : LONGINT ) : BOOLEAN ;
  1966.  
  1967. PROCEDURE PolyDraw( rp : RastPortPtr; count : LONGINT ; polyTable : ADDRESS );
  1968. PROCEDURE SetAPen( rp : RastPortPtr; pen : LONGINT );
  1969. PROCEDURE SetBPen( rp : RastPortPtr; pen : LONGINT );
  1970. PROCEDURE SetDrMd( rp : RastPortPtr; drawMode : SHORTSET );
  1971. PROCEDURE InitView( view : View );
  1972. PROCEDURE CBump( copList : UCopListPtr ) ;
  1973. PROCEDURE CMove( copList : UCopListPtr ;
  1974.          destination : ADDRESS ;
  1975.          data : LONGINT ) ;
  1976. PROCEDURE CWait( copList : UCopListPtr; v : LONGINT; h : LONGINT );
  1977. PROCEDURE VBeamPos( ) : LONGINT ;
  1978.  
  1979. PROCEDURE InitBitMap( VAR bitMap : BitMap ; depth , width , height : LONGINT ) ;
  1980.  
  1981. PROCEDURE ScrollRaster( rp   : RastPortPtr ;
  1982.             dx   : LONGINT ;
  1983.             dy   : LONGINT ;
  1984.             xMin : LONGINT ;
  1985.             yMin : LONGINT ;
  1986.             xMax : LONGINT ;
  1987.             yMax : LONGINT ) ;
  1988.  
  1989. PROCEDURE WaitBOVP( vp : ViewPortPtr ) ;
  1990. PROCEDURE GetSprite( sprite : SimpleSpritePtr ; num : LONGINT ) : INTEGER ;
  1991. PROCEDURE FreeSprite( num : LONGINT ) ;
  1992.  
  1993. PROCEDURE ChangeSprite( vp    : ViewPortPtr ;
  1994.             sprite  : SimpleSpritePtr ;
  1995.             newData : PLANEPTR ) ;
  1996.  
  1997. PROCEDURE MoveSprite( vp     : ViewPortPtr ;
  1998.               sprite : SimpleSpritePtr ;
  1999.               x, y   : LONGINT ) ;
  2000.  
  2001. PROCEDURE LockLayerRom( layer : LayerPtr ) ;
  2002. PROCEDURE UnlockLayerRom( layer : LayerPtr ) ;
  2003. PROCEDURE SyncSBitMap( layer : LayerPtr ) ;
  2004. PROCEDURE CopySBitMap( layer : LayerPtr ) ;
  2005. PROCEDURE OwnBlitter( ) ;
  2006. PROCEDURE DisownBlitter( ) ;
  2007.  
  2008. PROCEDURE InitTmpRas( VAR tmpRas : TmpRas ;
  2009.               buffer : PLANEPTR  ;
  2010.               size   : LONGINT ) : TmpRasPtr ;
  2011.  
  2012. PROCEDURE AskFont( rp : RastPortPtr ; textAttr : TextAttrPtr ) ;
  2013. PROCEDURE AddFont( textFont : TextFontPtr ) ;
  2014. PROCEDURE RemFont( textFont : TextFontPtr ) ;
  2015. PROCEDURE AllocRaster( width : LONGINT ; height : LONGINT ) : PLANEPTR ;
  2016. PROCEDURE FreeRaster( p : PLANEPTR ; width : LONGINT ; height : LONGINT ) ;
  2017.  
  2018. PROCEDURE AndRectRegion( region : RegionPtr ; rectangle : RectanglePtr ) ;
  2019.  
  2020. PROCEDURE OrRectRegion( region : RegionPtr ;
  2021.             rectangle : RectanglePtr ) : BOOLEAN ;
  2022.  
  2023. PROCEDURE NewRegion( ) : RegionPtr ;
  2024.  
  2025. PROCEDURE ClearRectRegion( region    : RegionPtr ;
  2026.                rectangle : RectanglePtr ) : BOOLEAN ;
  2027.  
  2028. PROCEDURE ClearRegion( region   : RegionPtr ) ;
  2029. PROCEDURE DisposeRegion( region : RegionPtr ) ;
  2030. PROCEDURE FreeVPortCopLists( vp : ViewPortPtr ) ;
  2031. PROCEDURE FreeCopList( copList  : CopListPtr ) ;
  2032.  
  2033. PROCEDURE ClipBlit( srcRP   : RastPortPtr ;
  2034.             xSrc    : LONGINT ;
  2035.             ySrc    : LONGINT ;
  2036.             destRP  : RastPortPtr ;
  2037.             xDest   : LONGINT ;
  2038.             yDest   : LONGINT ;
  2039.             xSize   : LONGINT ;
  2040.             ySize   : LONGINT ;
  2041.             minterm : LONGINT ) ;
  2042.  
  2043. PROCEDURE XorRectRegion( region : RegionPtr ; rect : RectanglePtr ) : BOOLEAN ;
  2044. PROCEDURE FreeCprList( cprList : cprlistPtr ) ;
  2045. PROCEDURE GetColorMap( entries : LONGINT ) : ColorMapPtr ;
  2046. PROCEDURE FreeColorMap( colorMap : ColorMapPtr ) ;
  2047. PROCEDURE GetRGB4( colorMap : ColorMapPtr ; entry : LONGINT ) : LONGINT ;
  2048. PROCEDURE ScrollVPort( vp : ViewPortPtr ) ;
  2049. PROCEDURE UCopperListInit( uCopList : UCopListPtr ; n : LONGINT ): UCopListPtr ;
  2050.  
  2051. PROCEDURE FreeGBuffers( anOb  : AnimObPtr ;
  2052.             rp    : RastPortPtr ;
  2053.             db    : BOOLEAN ) ;
  2054.  
  2055. PROCEDURE BltBitMapRastPort( srcBitMap    : BitMapPtr ;
  2056.                  xSrc    : LONGINT ;
  2057.                  ySrc    : LONGINT ;
  2058.                  destRP    : RastPortPtr ;
  2059.                  xDest    : LONGINT ;
  2060.                  yDest    : LONGINT ;
  2061.                  xSize    : LONGINT ;
  2062.                  ySize    : LONGINT ;
  2063.                  minterm    : LONGINT ) ;
  2064.  
  2065. PROCEDURE OrRegionRegion ( srcRegion, destRegion : RegionPtr ) : BOOLEAN ;
  2066. PROCEDURE XorRegionRegion( srcRegion, destRegion : RegionPtr ) : BOOLEAN ;
  2067. PROCEDURE AndRegionRegion( srcRegion, destRegion : RegionPtr ) : BOOLEAN ;
  2068.  
  2069. PROCEDURE SetRGB4CM( colorMap : ColorMapPtr ;
  2070.              index, red, green, blue : LONGINT ) ;
  2071.  
  2072. PROCEDURE BltMaskBitMapRastPort( srcBitMap : BitMapPtr ;
  2073.                  xSrc       : LONGINT ;
  2074.                  ySrc       : LONGINT ;
  2075.                  destRP       : RastPortPtr ;
  2076.                  xDest       : LONGINT ;
  2077.                  yDest       : LONGINT ;
  2078.                  xSize       : LONGINT ;
  2079.                  ySize       : LONGINT ;
  2080.                  minterm   : LONGINT ;
  2081.                  bltMask   : PLANEPTR ) ;
  2082.  
  2083. PROCEDURE AttemptLockLayerRom( layer : LayerPtr ) : BOOLEAN ;
  2084.  
  2085. (*--------------- functions in V36 or higher (Release 2.0) -------------------*)
  2086.  
  2087. PROCEDURE GfxNew( gfxNodeType : LONGINT ) : ADDRESS ;
  2088. PROCEDURE GfxFree( gfxNodePtr : ADDRESS ) ;
  2089. PROCEDURE GfxAssociate( associateNode : ADDRESS ; gfxNodePtr : ADDRESS ) ;
  2090. PROCEDURE BitMapScale( bitScaleArgs : BitScaleArgsPtr ) ;
  2091. PROCEDURE ScalerDiv( factor , numerator , denominator : LONGINT ) : CARDINAL ;
  2092.  
  2093. PROCEDURE TextExtent( rp     : RastPortPtr ;
  2094.               string     : STRING ;
  2095.               count     : LONGINT ;
  2096.               textExtent : TextExtentPtr ) : INTEGER ;
  2097.  
  2098. PROCEDURE TextFit( rp : RastPortPtr ;
  2099.            string : STRING ;
  2100.            strLen : LONGINT;
  2101.            textExtent : TextExtentPtr ;
  2102.            constrainingExtent : TextExtentPtr ;
  2103.            strDirection : LONGINT ;
  2104.            constrainingBitWidth  : LONGINT ;
  2105.            constrainingBitHeight : LONGINT ) : LONGINT ;
  2106.  
  2107. PROCEDURE GfxLookUp( associateNode : ADDRESS ) : ADDRESS ;
  2108.  
  2109. PROCEDURE VideoControl( colorMap : ColorMapPtr ;
  2110.             tagarray : TagItemPtr ) : BOOLEAN ;
  2111.  
  2112. PROCEDURE VideoControlTags( colorMap : ColorMapPtr ;
  2113.                 tag1Type : LONGINT ; .. ) : BOOLEAN ;
  2114.  
  2115. PROCEDURE OpenMonitor( monitorName : STRING ;
  2116.                displayID   : LONGINT ) : MonitorSpecPtr ;
  2117.  
  2118. PROCEDURE CloseMonitor( monitorSpec : MonitorSpecPtr ) : BOOLEAN ;
  2119. PROCEDURE FindDisplayInfo( displayID : LONGINT ) : DisplayInfoHandle ;
  2120. PROCEDURE NextDisplayInfo( displayID : LONGINT ) : LONGINT ;
  2121.  
  2122. PROCEDURE GetDisplayInfoData( handle    : DisplayInfoHandle ;
  2123.                   buf    : ADDRESS ;
  2124.                   size    : LONGINT ;
  2125.                   tagID    : LONGINT ;
  2126.                   displayID : LONGINT ) : LONGINT ;
  2127.  
  2128. PROCEDURE FontExtent( font : TextFontPtr ; fontExtent : TextExtentPtr ) ;
  2129.  
  2130. PROCEDURE ReadPixelLine8( rp     : RastPortPtr ;
  2131.               xstart : LONGINT ;
  2132.               ystart : LONGINT ;
  2133.               width  : LONGINT ;
  2134.               array  : ADDRESS ;
  2135.               tempRP : RastPortPtr ) : LONGINT ;
  2136.  
  2137. PROCEDURE WritePixelLine8( rp : RastPortPtr ;
  2138.                xstart, ystart, width : LONGINT ;
  2139.                array  : ADDRESS ;
  2140.                tempRP : RastPortPtr ) : LONGINT ;
  2141.  
  2142. PROCEDURE ReadPixelArray8( rp : RastPortPtr ;
  2143.                xstart, ystart, xstop, ystop : LONGINT;
  2144.                array  : ADDRESS ;
  2145.                temprp : RastPortPtr ) : LONGINT ;
  2146.  
  2147. PROCEDURE WritePixelArray8( rp       : RastPortPtr ;
  2148.                 xstart, ystart, xstop, ystop  : LONGINT ;
  2149.                 array  : ADDRESS ;
  2150.                 temprp : RastPortPtr ) : LONGINT ;
  2151.  
  2152. PROCEDURE GetVPModeID( vp : ViewPortPtr ) : LONGINT ;
  2153. PROCEDURE ModeNotAvailable( modeID : LONGINT ) : LONGINT ;
  2154.  
  2155. PROCEDURE WeighTAMatch( reqTextAttr    : TextAttrPtr ;
  2156.             targetTextAttr    : TextAttrPtr ;
  2157.             targetTags    : TagItemPtr ) : INTEGER ;
  2158.  
  2159. PROCEDURE WeighTAMatchTags( reqTextAttr       : TextAttrPtr ;
  2160.                 targetTextAttr : TextAttrPtr ;
  2161.                 tag1Type       : LONGINT ; .. ) : INTEGER ;
  2162.  
  2163. PROCEDURE EraseRect( rp    : RastPortPtr ; xMin, yMin, xMax, yMax : LONGINT ) ;
  2164.  
  2165. PROCEDURE ExtendFont( font     : TextFontPtr ;
  2166.               fontTags : TagItemPtr ) : LONGINT ;
  2167.  
  2168. PROCEDURE ExtendFontTags( font     : TextFontPtr ;
  2169.               tag1Type : LONGINT ; .. ) : LONGINT ;
  2170.  
  2171. PROCEDURE StripFont( font : TextFontPtr ) ;
  2172.  
  2173. (*----------------- functions in V39 or higher (Release 3) -------------------*)
  2174.  
  2175. PROCEDURE CalcIVG( v : ViewPtr ; vp : ViewPortPtr ) : CARDINAL ;
  2176. PROCEDURE AttachPalExtra( cm : ColorMapPtr ; vp : ViewPortPtr ) : LONGINT ;
  2177.  
  2178. PROCEDURE ObtainBestPenA( cm    : ColorMapPtr ;
  2179.               r,g,b : LONGINT ;
  2180.               tags  : TagItemPtr ) : LONGINT ;
  2181.  
  2182. PROCEDURE ObtainBestPen( cm : ColorMapPtr ;
  2183.              r,g,b,tag1Type : LONGINT ; .. ) : LONGINT ;
  2184.  
  2185. PROCEDURE SetRGB32( vp : ViewPortPtr ; n,r,g,b : LONGINT ) ;
  2186.  
  2187. PROCEDURE GetAPen( rp : RastPortPtr ) : LONGINT ;
  2188. PROCEDURE GetBPen( rp : RastPortPtr ) : LONGINT ;
  2189. PROCEDURE GetDrMd( rp : RastPortPtr ) : LONGINT ;
  2190. PROCEDURE GetOutlinePen( rp : RastPortPtr ) : LONGINT ;
  2191. PROCEDURE LoadRGB32( vp : ViewPortPtr ; table : ADDRESS ) ;
  2192. PROCEDURE SetChipRev( want : LONGSET ) : LONGSET ;
  2193.  
  2194. PROCEDURE SetABPenDrMd( rp : RastPortPtr ;
  2195.             apen : LONGINT ;
  2196.             bpen : LONGINT ;
  2197.             drawmode : SHORTSET ) ;
  2198.  
  2199. PROCEDURE GetRGB32( cm : ColorMapPtr ;
  2200.             firstcolor : LONGINT ;
  2201.             ncolors : LONGINT ;
  2202.             table : ADDRESS ) ;
  2203.  
  2204. PROCEDURE AllocBitMap( sizex : LONGINT ;
  2205.                sizey : LONGINT ;
  2206.                depth : LONGINT ;
  2207.                flags : SHORTSET ;
  2208.                friend_bitmap : BitMapPtr ) : BitMapPtr ;
  2209.  
  2210. PROCEDURE FreeBitMap( bm : BitMapPtr ) ;
  2211. PROCEDURE GetExtSpriteA( ss : ExtSpritePtr ; tags : TagItemPtr ) : LONGINT ;
  2212. PROCEDURE GetExtSprite( ss : ExtSpritePtr ; tag1Type : LONGINT; .. ): LONGINT ;
  2213.  
  2214. PROCEDURE CoerceMode( vp    : ViewPortPtr;
  2215.               monitorid : LONGINT;
  2216.               flags    : LONGSET ) : LONGINT ;
  2217.  
  2218. PROCEDURE ChangeVPBitMap( vp : ViewPortPtr ;
  2219.               bm : BitMapPtr ;
  2220.               db : DBufInfoPtr ) ;
  2221.  
  2222. PROCEDURE ReleasePen( cm : ColorMapPtr ; n : LONGINT ) ;
  2223.  
  2224. PROCEDURE ObtainPen( cm : ColorMapPtr ;
  2225.               n : LONGINT ;
  2226.               r : LONGINT ;
  2227.               g : LONGINT ;
  2228.               b : LONGINT ;
  2229.               f : LONGSET ) : LONGINT ;
  2230.  
  2231. PROCEDURE GetBitMapAttr( bm : BitMapPtr ; attrnum : LONGINT ) : LONGINT ;
  2232. PROCEDURE AllocDBufInfo( vp : ViewPortPtr ) : DBufInfoPtr ;
  2233. PROCEDURE FreeDBufInfo( dbi : DBufInfoPtr ) ;
  2234. PROCEDURE SetOutlinePen( rp : RastPortPtr ; pen : LONGINT ) : LONGINT ;
  2235. PROCEDURE SetWriteMask( rp : RastPortPtr ; msk : SHORTSET ) : LONGINT ;
  2236. PROCEDURE SetMaxPen( rp : RastPortPtr ; maxpen : LONGINT ) ;
  2237.  
  2238. PROCEDURE SetRGB32CM( cm : ColorMapPtr ;
  2239.                n : LONGINT ;
  2240.                r : LONGINT ;
  2241.                g : LONGINT ;
  2242.                b : LONGINT ) ;
  2243.  
  2244. PROCEDURE ScrollRasterBF( rp   : RastPortPtr ;
  2245.               dx   : LONGINT ;
  2246.               dy   : LONGINT ;
  2247.               xMin : LONGINT ;
  2248.               yMin : LONGINT ;
  2249.               xMax : LONGINT ;
  2250.               yMax : LONGINT ) ;
  2251.  
  2252. PROCEDURE FindColor(    cm : ColorMapPtr ;
  2253.             r  : LONGINT ;
  2254.             g  : LONGINT ;
  2255.             b  : LONGINT ;
  2256.             maxcolor : LONGINT ) : LONGINT ;
  2257.  
  2258. PROCEDURE AllocSpriteDataA( bm : BitMapPtr; tags : TagItemPtr ) : ExtSpritePtr ;
  2259. PROCEDURE AllocSpriteData( bm        : BitMapPtr ;
  2260.                tag1Type : LONGINT ; .. ) : ExtSpritePtr ;
  2261.  
  2262. PROCEDURE ChangeExtSpriteA( vp          : ViewPortPtr  ;
  2263.                 oldsprite : ExtSpritePtr ;
  2264.                 newsprite : ExtSpritePtr ;
  2265.                 tags      : TagItemPtr ) : LONGINT ;
  2266.  
  2267. PROCEDURE ChangeExtSprite( vp         : ViewPortPtr ;
  2268.                oldsprite : ExtSpritePtr ;
  2269.                newsprite : ExtSpritePtr ;
  2270.                tag1Type  : LONGINT ; .. ) : LONGINT ;
  2271.  
  2272. PROCEDURE FreeSpriteData( sp : ExtSpritePtr ) ;
  2273. PROCEDURE SetRPAttrsA( rp : RastPortPtr ; tags : TagItemPtr ) ;
  2274. PROCEDURE SetRPAttrs( rp : RastPortPtr ; tag1Type : LONGINT; .. ) ;
  2275. PROCEDURE GetRPAttrsA( rp : RastPortPtr ; tags : TagItemPtr ) ;
  2276. PROCEDURE GetRPAttrs( rp : RastPortPtr ; tag1Type : LONGINT ; .. ) ;
  2277. PROCEDURE BestModeIDA( tags : TagItemPtr ) : LONGINT ;
  2278. PROCEDURE BestModeID ( tag1Type : LONGINT ; .. ) : LONGINT ;
  2279.  
  2280. (*---------------- functions in V40 or higher (Release 3.1) ------------------*)
  2281.  
  2282. PROCEDURE WriteChunkyPixels( rp        : RastPortPtr ;
  2283.                  xstart : LONGINT ;
  2284.                  ystart : LONGINT ;
  2285.                  xstop  : LONGINT ;
  2286.                  ystop  : LONGINT ;
  2287.                  array  : ADDRESS ;
  2288.                  bytesperrow : LONGINT ) ;
  2289.  
  2290. END Graphics.
  2291.